/* src/char-attr-tab.css
 * CHAR-ATTR-TAB-01 (#2810) — Attribute allocation tab content.
 * Mounts into #char-v3-attrs-body (inside #char-panel-v3 — the char-panel-v2 shell
 * was retired by BODY-RECON-STATS-ATTRS-01 #4159).
 */

/* ATTR-V2-STATSHEET-01 (P7b): redesigned attribute allocation surface — an
 * always-visible card per attribute (no expand-to-see), the AP pool headlined,
 * the escalating next-point cost on every + button, FLEE-only (the confusing
 * Dodge+FLEE pair was removed). The full resolved stat sheet lives in the
 * adjacent STATS section. */

/* ── ATTR-V2-STATSHEET-02: two-column Attributes | Stats sheet ────────── */
/* LEFT = attribute allocation list; RIGHT = the resolved derived stats sheet.
 * Both render from the same snapshot payload (one coherent source). Collapses to
 * a single column under the existing ~940px panel breakpoint. */

.char-sheet-two-col {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 18px;
  /* Reserve space at the bottom so the floating Mastery HUD pill (#um-hud-pill,
   * fixed bottom:118px right:12px) never overlaps the last Stats row / the
   * Dexterity card. The pill sits ~bottom-right; this padding keeps the sheet's
   * final rows clear of it when the panel scrolls to the end. */
  padding-bottom: 64px;
}

.char-sheet-col { min-width: 0; }
.char-sheet-col--attrs { flex: 1 1 52%; }
.char-sheet-col--stats { flex: 1 1 48%; }

/* The attribute list is a single tight column in two-column mode (the cards no
 * longer auto-fit into multiple columns — the sheet is the wide element). */
.char-sheet-two-col .char-attr-list {
  grid-template-columns: 1fr;
}

@media (max-width: 940px) {
  .char-sheet-two-col { flex-direction: column; gap: 12px; }
  .char-sheet-col--attrs,
  .char-sheet-col--stats { flex: 1 1 auto; width: 100%; }
}

/* ── RIGHT column — resolved Stats sheet ──────────────────────────────── */

.char-stat-sheet-hd {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6eb4dc;
  opacity: 0.85;
  margin: 0 0 8px;
}

.char-stat-sheet {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 18px;
  align-items: start;
}

.char-stat-group { min-width: 0; }

.char-stat-group-hd {
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #6eb4dc;
  opacity: 0.7;
  font-weight: 700;
  margin: 0 0 3px;
}

.char-stat-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  padding: 1px 2px;
}

.char-stat-name {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.char-stat-val {
  font-size: 11px;
  color: #e2e8f0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Green gear-bonus delta (total − base), shown only when meaningfully nonzero. */
.char-stat-bonus {
  margin-left: 5px;
  font-size: 10px;
  font-weight: 700;
  color: #4ade80;
}

/* Green per-attribute bonus (attrBonus[key] > 0) — invisible today (all 0). */
.char-attr-row__bonus {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #4ade80;
  vertical-align: baseline;
}

/* ── AP pool header ──────────────────────────────────────────────────── */

.char-attr-ap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  background: rgba(56, 189, 248, 0.09);
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 8px;
  margin-bottom: 10px;
}

.char-attr-ap__main {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.char-attr-ap__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(200, 210, 220, 0.60);
}

.char-attr-ap__count {
  font-size: 22px;
  font-weight: 800;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.char-attr-ap--empty .char-attr-ap__count {
  color: rgba(200, 210, 220, 0.35);
}

.char-attr-ap__econ {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(200, 210, 220, 0.42);
  font-variant-numeric: tabular-nums;
}

/* ATTR-V2-CLASS-SEED-01 (#4800): the opt-in "Suggested" class-build preset
   button. Sits in the AP header; only rendered when a class lean exists and
   becomes disabled (dimmed, non-interactive) at 0 unspent AP. Cyan-accent to
   match the AP chip; never visually shouts (it is a nudge, not a CTA). */
.char-attr-suggest {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  white-space: nowrap;
}

.char-attr-suggest:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.66);
}

.char-attr-suggest:disabled {
  opacity: 0.4;
  cursor: default;
  color: rgba(200, 210, 220, 0.45);
  border-color: rgba(200, 210, 220, 0.20);
  background: rgba(200, 210, 220, 0.05);
}

.char-attr-suggest__icon { font-size: 12px; line-height: 1; }

/* ── Attribute cards ─────────────────────────────────────────────────── */

.char-attr-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
  gap: 7px;
}

.char-attr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(20, 20, 36, 0.80);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  transition: border-color 0.12s, background 0.12s;
}

.char-attr-row:hover {
  border-color: rgba(110, 180, 220, 0.40);
  background: rgba(28, 30, 48, 0.85);
}

.char-attr-row__icon {
  flex-shrink: 0;
  font-size: 17px;
  width: 22px;
  text-align: center;
  line-height: 1;
}

.char-attr-row__main {
  flex: 1;
  min-width: 0;
}

.char-attr-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.char-attr-row__name {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.char-attr-row__value {
  font-size: 17px;
  font-weight: 800;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.char-attr-row__cap {
  font-size: 10px;
  font-weight: 600;
  color: rgba(200, 210, 220, 0.34);
  margin-left: 1px;
}

/* Derived stats hint (signature 2–3 effects; full sheet is in STATS) */

.char-attr-row__derived {
  font-size: 10px;
  color: rgba(200, 210, 220, 0.50);
  line-height: 1.3;
  margin-top: 2px;
  white-space: normal;
}

/* + button — sign over the escalating cost */

.char-attr-row__plus {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 40px;
  padding: 4px 6px;
  font-weight: 700;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.10);
  border: 1px solid rgba(56, 189, 248, 0.30);
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.1s, opacity 0.1s;
}

.char-attr-row__plus-sign {
  font-size: 15px;
}

.char-attr-row__plus-cost {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: rgba(200, 210, 220, 0.55);
  font-variant-numeric: tabular-nums;
}

.char-attr-row__plus:hover:not(:disabled) {
  background: rgba(56, 189, 248, 0.22);
}

.char-attr-row__plus:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.char-attr-row__plus:disabled {
  opacity: 0.30;
  cursor: not-allowed;
}

/* Field-mode lock notice */

.char-attr-field-lock {
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 5px;
  font-size: 11px;
  color: #fbbf24;
  text-align: center;
}

/* Rejection inline error */

.char-attr-error {
  margin-top: 6px;
  font-size: 11px;
  color: #f87171;
  text-align: center;
  min-height: 14px;
}

/* Version mismatch (read-only) */

.char-attr-readonly-notice {
  padding: 8px 12px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 6px;
  font-size: 12px;
  color: #fbbf24;
  text-align: center;
}
