/* =============================================================================
   IDENTITY BLOCK
   ============================================================================= */

.identity-block {
  margin-bottom: 2px;
}

.indent {
  padding-left: 2rem;
}

/* =============================================================================
   PORTRAIT IMAGE
   ============================================================================= */

.lra-image {
  max-height: 75vh;
  width: auto;
  max-width: 100%;
  display: block;
  border: none !important;
  border-image: none !important;
  filter: url(#duotone-maroon-parchment);
}

#social-bar img {
  filter: url(#icon-maroon);
  border: none !important;
  border-image: none !important;
}

#icq img {
  border: none !important;
  border-image: none !important;
}

#social-bar .pipe {
  color: var(--maroon-mid);
}

/* =============================================================================
   VITALS — HP / AC / SPEED
   ============================================================================= */

.section-vitals {
  display: flex;
  justify-content: center;
}

.vitals-row {
  display: flex;
  gap: 20px;
  align-items: flex-end;
}

.vital {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.vital-shape {
  width: 72px;
  height: 72px;
}

.vital-label {
  font-family: var(--font-ui);
  font-size: 9pt;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--maroon-mid);
  margin: 0;
  text-transform: uppercase;
}

/* =============================================================================
   ABILITIES TABLE
   ============================================================================= */

.abilities-frame {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.brace-svg {
  padding-top: 1rem;
  width: 28px;
  scale: 130%;
  flex-shrink: 0;
}

.abilities-columns {
  display: flex;
  flex: 1;
}

.abilities-col {
  flex: 1;
  padding: 0 6px;
}

.abilities-col:first-child {
  border-right: 1.5px solid var(--maroon-mid);
  padding-left: 0;
}

.abilities-col:last-child {
  padding-right: 0;
}

.abilities-col-header {
  font-family: var(--font-ui);
  font-size: 9pt;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--maroon-mid);
  margin: 0 0 2px 0;
  border-bottom: 1.5px solid var(--maroon-mid);
  padding-bottom: 2px;
}

.abilities-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.abilities-list li {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--maroon-pale);
  padding: 1px 0;
  min-height: 22px;
}

.abilities-list li::before {
  content: '○';
  font-family: var(--font-display);
  font-size: 16pt;
  color: var(--maroon-mid);
  flex-shrink: 0;
  line-height: 1;
}

.abilities-list li.empty {
  opacity: 0.35;
}

.ability-text {
  display: inline-block;
  transform-origin: left center;
}

/* =============================================================================
   STAT BOX NUMBER TRANSFORMS — hand-drawn rotation per row
   ============================================================================= */

.stat-item:nth-child(1) .stat-box span {
  transform: rotate(-12deg) translate(1px, -2px);
  display: inline-block;
  font-weight: 100;
}

.stat-item:nth-child(2) .stat-box span {
  transform: rotate(8deg) translate(3px, 1px);
  display: inline-block;
}

.stat-item:nth-child(2) .stat-box span::before {
  content: "9";
  position: absolute;
  top: 0;
  left: 0;
  color: rgba(60, 60, 60, 0.2);
  transform: rotate(-9deg) translate(4px, -3px);
  z-index: -1;
  font-weight: 100;
}

.stat-item:nth-child(3) .stat-box span {
  transform: rotate(-6deg) translate(2px, 0px);
  display: inline-block;
  font-weight: 100;
}

.stat-item:nth-child(4) .stat-box span {
  transform: rotate(14deg) translate(0px, 0px);
  display: inline-block;
  font-weight: 900;
}

.stat-item:nth-child(5) .stat-box span {
  transform: rotate(-9deg) translate(-1px, 0px);
  display: inline-block;
  font-weight: 200;
}

.stat-item:nth-child(5) .stat-box span::before {
  content: "15";
  position: absolute;
  top: 0;
  left: 0;
  color: rgba(60, 60, 60, 0.2);
  transform: rotate(-6deg) translate(3px, 1px);
  z-index: -1;
  font-weight: 100;
}

.stat-item:nth-child(6) .stat-box span {
  transform: rotate(13deg) translate(2px, -3px);
  display: inline-block;
  font-weight: 900;
}

.stat-item:nth-child(7) .stat-box span {
  transform: rotate(-7deg) translate(0px, 1px);
  display: inline-block;
}

/* =============================================================================
   SAVING THROW TRANSFORMS — per-row rotation via CSS custom properties
   ============================================================================= */

.saving-throw-item:nth-child(1) {
  --box-rotation: 90deg;   --content-rotation: 9deg;
  --translate-x: -1px;     --translate-y: 0px;
  --font-weight: normal;
  --border-top: 7px; --border-right: 6px; --border-bottom: 4px; --border-left: 3px;
}

.saving-throw-item:nth-child(2) {
  --box-rotation: 0deg;    --content-rotation: -7deg;
  --translate-x: 1px;      --translate-y: -1px;
  --font-weight: normal;
  --border-top: 3px; --border-right: 6px; --border-bottom: 6px; --border-left: 4px;
}

.saving-throw-item:nth-child(3) {
  --box-rotation: 0deg;    --content-rotation: 12deg;
  --translate-x: 0px;      --translate-y: 1px;
  --font-weight: bold;
  --border-top: 3px; --border-right: 6px; --border-bottom: 7px; --border-left: 4px;
}

.saving-throw-item:nth-child(4) {
  --box-rotation: 270deg;  --content-rotation: -5deg;
  --translate-x: -1px;     --translate-y: 1px;
  --font-weight: bold;
  --border-top: 4px; --border-right: 3px; --border-bottom: 6px; --border-left: 8px;
}

.saving-throw-item:nth-child(5) {
  --box-rotation: 90deg;   --content-rotation: 8deg;
  --translate-x: 1px;      --translate-y: 0px;
  --font-weight: bold;
  --border-top: 6px; --border-right: 6px; --border-bottom: 3px; --border-left: 4px;
}

.saving-throw-item:nth-child(6) {
  --box-rotation: 0deg;    --content-rotation: -11deg;
  --translate-x: 0px;      --translate-y: -1px;
  --font-weight: normal;
  --border-top: 3px; --border-right: 6px; --border-bottom: 8px; --border-left: 3px;
}

.saving-throw-item:nth-child(7) {
  --box-rotation: 270deg;  --content-rotation: 6deg;
  --translate-x: -1px;     --translate-y: 1px;
  --font-weight: normal;
  --border-top: 4px; --border-right: 3px; --border-bottom: 6px; --border-left: 7px;
}

.saving-throw-item .saving-throw-box {
  transform: rotate(var(--box-rotation, 0deg));
  border-top-width: var(--border-top);
  border-right-width: var(--border-right);
  border-bottom-width: var(--border-bottom);
  border-left-width: var(--border-left);
}

.saving-throw-item .saving-throw-box span {
  transform: rotate(calc(var(--content-rotation, 0deg) - var(--box-rotation, 0deg)))
             translate(var(--translate-x, 0px), var(--translate-y, 0px));
  display: inline-block;
  font-weight: var(--font-weight);
}

.saving-throw-item:nth-child(3) .saving-throw-box span::before {
  content: "-1";
  position: absolute; top: 0; left: 0;
  color: rgba(60, 60, 60, 0.2);
  transform: rotate(9deg) translate(2px, -1px);
  z-index: -1; font-weight: 200;
}

.saving-throw-item:nth-child(4) .saving-throw-box span::before {
  content: "-2";
  position: absolute; top: 0; left: 0;
  color: rgba(60, 60, 60, 0.2);
  transform: rotate(-9deg) translate(-1px, 1px);
  z-index: -1; font-weight: 100;
}

.saving-throw-item:nth-child(5) .saving-throw-box span::before {
  content: "0";
  position: absolute; top: 0; left: 0;
  color: rgba(60, 60, 60, 0.2);
  transform: rotate(-9deg) translate(1px, 1px);
  z-index: -1; font-weight: 700;
}

/* =============================================================================
   CHARACTER STAT / SAVING THROW BOX OVERRIDES
   ============================================================================= */

.stat-box,
.saving-throw-box {
  background-color: var(--parchment-box) !important;
  color: var(--maroon-deep);
}

/* =============================================================================
   GRUNGE FILTER APPLICATIONS
   Applied only to elements using --maroon-deep.
   Filter is defined as an inline SVG in index.html.
   ============================================================================= */

.identity-main,
.ability-text,
.brace-svg,
.section-header-title,
.character-card h4,
.stat-name,
.stat-box span,
.saving-throw-name,
.saving-throw-box span {
  filter: url(#grunge);
}
