/* ==========================================================
   Character Sheet Theme Reset
   Based on working pre-module-split architecture
   Loaded AFTER dnd.css to override previous experimental patches
   ========================================================== */

.character-page-v5{
  --char-block-bg: color-mix(in srgb, var(--char-theme) 68%, white 32%);
  --char-title-bg: color-mix(in srgb, var(--char-theme) 76%, white 24%);
  --char-border: color-mix(in srgb, var(--char-theme) 80%, black);
  --char-panel: #f4f7f2;
  --char-grey-panel: #b9c0ca;
}

/* Title/header */
.character-theme-title,
.character-title-bar{
  background: var(--char-title-bg) !important;
  color: white !important;
  border: 2px solid rgba(255,255,255,.22) !important;
}

/* The four character sheet block shells */
.character-sheet-body,
.character-sheet-body-v5,
.character-sheet-block-two,
.character-sheet-block-three,
.character-sheet-block-four{
  background: var(--char-block-bg) !important;
  border-color: var(--char-border) !important;
}

/* Structural wrappers stay transparent so the block colour shows through */
.character-sheet-body-v5 > *,
.character-sheet-block-two > *,
.character-sheet-block-three > *,
.character-sheet-block-four > *,
.power-grid,
.routine-top-row,
.two-wide-boxes,
.other-things-grid{
  background: transparent !important;
}

/* Standard readable panels */
.character-portrait,
.saving-skills-table,
.character-data-table,
.combat-top-row > div,
.hp-box,
.hit-points-box,
.temp-hit-points-box,
.hit-dice-box,
.death-save-box,
.death-saves-box,
.combat-stat-box,
.class-benefits-full,
.power-box,
.power-box h3,
.power-box div,
.routine-top-row > div,
.two-wide-boxes .character-section,
.other-things-intro,
.other-things-grid .character-section{
  background: var(--char-panel) !important;
  color: #111 !important;
}

/* Block 1 grey text panels from the original working layout */
.character-right-column-v4 .character-section,
.prof-box,
.equipment-box,
.traits-full{
  background: var(--char-grey-panel) !important;
  color: #111 !important;
}

/* Languages panel was intentionally light in the working version */
.languages-full{
  background: var(--char-panel) !important;
  color: #111 !important;
}

/* Keep all inner text readable */
.character-page-v5 .character-section *,
.character-page-v5 .prof-box *,
.character-page-v5 .equipment-box *,
.character-page-v5 .traits-full *,
.character-page-v5 .languages-full *,
.character-page-v5 .class-benefits-full *,
.character-page-v5 .power-box *,
.character-page-v5 .other-things-intro *,
.character-page-v5 .other-things-grid *{
  color: #111 !important;
}

/* Preserve green section headings */
.character-page-v5 h2,
.character-page-v5 h3,
.character-page-v5 strong{
  color: var(--char-theme-dark, #2f6c2f) !important;
}

/* Sync all four character page block shells */
.character-sheet-body,
.character-sheet-body-v5,
.character-sheet-block-two,
.character-sheet-block-three,
.character-sheet-block-four{
  background: var(--char-block-bg) !important;
}

/* Header should be only slightly stronger than the blocks */
.character-theme-title,
.character-title-bar{
  background: var(--char-title-bg) !important;
}

/* Standard panel border for readable text boxes */
.character-page-v5 .character-section,
.character-page-v5 .prof-box,
.character-page-v5 .equipment-box,
.character-page-v5 .traits-full,
.character-page-v5 .languages-full,
.character-page-v5 .class-benefits-full,
.character-page-v5 .power-box,
.character-page-v5 .other-things-intro,
.character-page-v5 .other-things-grid .character-section,
.character-page-v5 .character-data-table,
.character-page-v5 .saving-skills-table,
.character-page-v5 .combat-stat-box,
.character-page-v5 .hit-points-box,
.character-page-v5 .temp-hit-points-box,
.character-page-v5 .hit-dice-box,
.character-page-v5 .death-saves-box{
  border: 1px solid #111 !important;
}

/* Character action buttons readable */
.character-page-v5 .hank-button,
.character-page-v5 button{
  color: #f4f7f2 !important;
}

/* Character theme select should remain readable */
.character-page-v5 select,
.character-page-v5 option{
  color: #111 !important;
}

/* Character action controls moved under ability scores */
.character-left-actions{
  display:flex !important;
  flex-direction:column !important;
  gap:12px !important;
  width:100% !important;
  margin-top:18px !important;
  padding:0 !important;
  background:transparent !important;
  border:0 !important;
}

.character-left-actions .hank-button,
.character-left-actions button{
  width:100% !important;
  color:#f4f7f2 !important;
}

.character-left-actions select,
.character-left-actions .theme-edit-input{
  width:100% !important;
  max-width:100% !important;
  color:#111 !important;
}

.character-left-actions .danger-button{
  margin-top:12px !important;
}

/* Ensure D&D readable panels preserve the universal H.A.N.K. info-box border */
.character-page-v5 .hank-info-box {
  border: 1px solid #111 !important;
}

/* Centre selected Character Profile info-box headings */
.prof-box h3,
.equipment-box h3,
.traits-full h3 {
  text-align: center;
}
