/* realms.css — three realm columns showing attributes, defense,
 * resource pool, and (physical only) DEFLECT.
 *
 * Slice origin: physical-realm + cognitive-realm + spiritual-realm.
 * Replaces the legacy #attributes-bar section. */

.realms-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-md);
  padding: var(--sp-md);
}

@container sheet (min-width: 40rem) {
  .realms-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

.realms-row__realm {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
}

.realms-row__title {
  font-size: var(--fs-heading);
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.realms-row__block {
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  padding: var(--sp-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
}

/* Attribute row: [attr0, defense, attr1] — three equal columns */
.realms-row__attrs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--sp-sm);
}

.realms-row__attr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xxs);
  padding: var(--sp-sm);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  text-align: center;
}

.realms-row__attr-label {
  font-size: var(--fs-caption);
  color: var(--color-fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Resource row: pool-area (label + MAXIMUM sub + max value)
 * + current-area (CURRENT label + editable box)
 * + deflect-area (physical only) */
/* Resources row matches the slice: HEALTH-MAX and CURRENT boxes are
 * the same size (3fr each), optionally followed by a narrower
 * DEFLECT box (1fr) on physical. Same visual weight as attribute
 * cells so the realm block reads as a coherent grid. */
.realms-row__resources {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm);
}

.realms-row__resources--physical {
  grid-template-columns: 3fr 3fr 1fr;
}

.realms-row__pool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xxs);
  padding: var(--sp-sm);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
}

.realms-row__pool-label {
  font-size: var(--fs-caption);
  color: var(--color-fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.realms-row__pool-max {
  font-size: var(--fs-display);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.realms-row__current {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xxs);
  padding: var(--sp-sm);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
}

.realms-row__current-label {
  font-size: var(--fs-caption);
  color: var(--color-fg-muted);
  text-transform: uppercase;
}

.realms-row__deflect {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-xxs);
  padding: var(--sp-sm);
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
}

.realms-row__deflect-box {
  font-size: var(--fs-display);
  font-weight: 700;
  padding: var(--sp-xs) var(--sp-sm);
}

.realms-row__deflect-label {
  font-size: var(--fs-caption);
  color: var(--color-fg-muted);
  text-transform: uppercase;
}

/* Visually-hide the inner .field-label emitted by createNumberField
 * inside attribute cells — the outer `.realms-row__attr-label` IS
 * the visible label. Same sr-only pattern as header.css. */
.realms-row__attr > .field-row > .field-label,
.realms-row__current > .field-row > .field-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
