/* Character sheet density and state-at-a-glance treatment. */

/* Keep the fixed stat block compact: two short rows per stat tile, minimal empty space. */
.character-page-shell section.card:has(> .stat-group-list) {
  padding: .9rem 1rem;
}

.character-page-shell section.card:has(> .stat-group-list) .section-heading h2 {
  margin: .15rem 0 0;
}

.character-page-shell .stat-group-list {
  gap: .45rem;
  margin-top: .55rem;
}

.character-page-shell .stat-group-row {
  grid-template-columns: minmax(100px, 125px) minmax(0, 1fr);
  gap: .55rem;
  padding-top: .45rem;
}

.character-page-shell .stat-group-heading {
  gap: .08rem;
  padding-top: .08rem;
}

.character-page-shell .stat-group-heading h3 {
  font-size: .82rem;
}

.character-page-shell .stat-group-row .stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: .35rem;
}

.character-page-shell .stat-group-row .stat-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .12rem .55rem;
  min-height: 0;
  padding: .45rem .55rem;
  border-radius: .48rem;
  border-left-width: 3px;
  transition: border-color .15s ease, background .15s ease;
}

.character-page-shell .stat-group-row .stat-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .7rem;
}

.character-page-shell .stat-group-row .stat-value {
  justify-self: end;
  font-size: 1.08rem;
  line-height: 1.1;
}

.character-page-shell .stat-group-row .stat-max {
  font-size: .75rem;
}

.character-page-shell .stat-group-row .stat-dice-summary {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.2;
}

.character-page-shell .stat-group-row .stat-card > .muted.tiny {
  justify-self: end;
  text-align: right;
  font-size: .67rem;
  line-height: 1.2;
}

/* Baseline stays deliberately neutral. State names remain visible so color is not the only cue. */
.character-page-shell .stat-card.stat-state-enhanced {
  border-color: #3d7358;
  background: linear-gradient(180deg, rgba(29, 76, 53, .58), rgba(16, 35, 27, .72));
}

.character-page-shell .stat-card.stat-state-enhanced .stat-state-label {
  color: #9ee3bd;
}

.character-page-shell .stat-card.stat-state-impaired {
  border-color: #8b6c30;
  background: linear-gradient(180deg, rgba(80, 61, 25, .58), rgba(42, 34, 20, .72));
}

.character-page-shell .stat-card.stat-state-impaired .stat-state-label {
  color: #f0ca70;
}

.character-page-shell .stat-card.stat-state-disabled {
  border-color: var(--danger-line);
  background: linear-gradient(180deg, rgba(86, 36, 45, .62), rgba(50, 27, 32, .78));
}

.character-page-shell .stat-card.stat-state-disabled .stat-state-label {
  color: #ffb8c1;
}

@media (max-width: 760px) {
  .character-page-shell .stat-group-row {
    grid-template-columns: 1fr;
    gap: .3rem;
  }

  .character-page-shell .stat-group-row .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  }

  .character-page-shell .stat-group-heading {
    grid-template-columns: 1fr auto;
    align-items: baseline;
  }
}
