/*
 * Pillar: a tinted column down the left carries the portrait under an arched
 * window and the six abilities as roundels with their skills beside them; the
 * wider column to the right holds the name, combat, vitals and notes.
 */

.pillar-page {
    display: grid;
    grid-template-columns: 68mm 1fr;
    column-gap: 7mm;
}

.pillar-spells {
    grid-template-columns: 46mm 1fr;
}

.pillar-spine {
    display: flex;
    flex-direction: column;
    gap: 6mm;
    min-height: 0;
    padding: 4mm;
    background-color: var(--card-accent-soft);
    background-image: linear-gradient(90deg, var(--card-accent-soft), transparent 42%, transparent 58%, var(--card-accent-soft));
    border-radius: 3mm 3mm 1mm 1mm;
}

.pillar-main {
    display: flex;
    flex-direction: column;
    gap: 4mm;
    min-width: 0;
    min-height: 0;
}

.pillar-page .sheet-toggle-mark {
    border-radius: 50%;
    transform: none;
}

.pillar-spine .sheet-input,
.pillar-spine .sheet-textarea {
    background: transparent;
    box-shadow: inset 0 0 0 0.25mm var(--card-rule);
}

/* ---------- the spine: portrait and roundels ---------- */

.pillar-page .sheet-portrait-frame {
    width: 60mm;
    height: 68mm;
    border-radius: 30mm 30mm 1mm 1mm;
}

.pillar-spine .inspiration {
    justify-content: center;
    margin-top: -3mm;
}

.pillar-abilities {
    display: flex;
    flex-direction: column;
    gap: 5mm;
}

.pillar-abilities .ability-block {
    display: grid;
    grid-template-columns: 4mm 16mm 1fr;
    column-gap: 2.4mm;
    align-items: start;
}

.pillar-roundel {
    grid-column: 1 / span 2;
    display: grid;
    grid-template-columns: 4mm 16mm;
    grid-template-rows: 16mm auto;
    column-gap: 2.4mm;
    align-items: start;
}

.pillar-roundel .ability-name {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    justify-self: center;
    font-family: var(--card-label-font);
    font-size: 5.8pt;
    letter-spacing: 0.1em;
    line-height: 1;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}

.pillar-roundel .ability-modifier {
    grid-column: 2;
    grid-row: 1;
}

.pillar-roundel .ability-modifier .sheet-input {
    width: 16mm;
    height: 16mm;
    padding: 0;
    font-size: 17pt;
    line-height: 16mm;
    border-radius: 50%;
}

.pillar-roundel .ability-score {
    grid-column: 2;
    grid-row: 2;
    width: 7.5mm;
    margin-top: -3.4mm;
    justify-self: center;
}

.pillar-roundel .ability-score .sheet-input {
    width: 7.5mm;
    height: 7.5mm;
    padding: 0;
    font-size: 8pt;
    line-height: 7.5mm;
    border-radius: 50%;
    background: var(--card-surface);
    box-shadow: inset 0 0 0 0.25mm var(--card-rule);
}

.pillar-ability-detail {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    gap: 1.6mm;
    min-width: 0;
}

.pillar-abilities .ability-save-value .sheet-input {
    border-radius: 2mm;
}

.pillar-abilities .skill-list {
    gap: 1.3mm;
}

.pillar-abilities .skill-row {
    gap: 1mm;
}

.pillar-abilities .skill-marks {
    gap: 0.8mm;
}

.pillar-abilities .sheet-toggle,
.pillar-abilities .sheet-toggle-mark {
    width: 3mm;
    height: 3mm;
}

.pillar-abilities .skill-modifier {
    width: 7mm;
}

.pillar-abilities .skill-name {
    font-size: 7.4pt;
}

.pillar-abilities .ability-aside .sheet-slot {
    flex-direction: row;
    align-items: center;
    gap: 2mm;
}

.pillar-abilities .ability-aside .sheet-slot-label {
    flex: 1;
    white-space: normal;
}

.pillar-abilities .aside-slot .sheet-input {
    width: 10mm;
    flex: none;
    border-radius: 2mm;
}

/* ---------- the main column ---------- */

.pillar-identity {
    display: flex;
    gap: 3mm;
    margin-bottom: 3mm;
}

.pillar-identity .sheet-slot {
    flex: 1;
}

.pillar-identity .identity-level {
    flex: none;
    width: 12mm;
}

.pillar-combat {
    display: grid;
    grid-template-columns: 22mm 18mm 1fr;
    column-gap: 5mm;
    align-items: start;
}

.pillar-shield .sheet-slot-label,
.pillar-disc .sheet-slot-label {
    text-align: center;
}

.pillar-shield .sheet-input {
    height: 24mm;
    padding: 4mm 0 0;
    font-family: var(--card-title-font);
    font-weight: var(--card-title-weight);
    font-size: 18pt;
    text-align: center;
    color: var(--card-accent);
    background: var(--card-accent-soft);
    border-radius: 0;
    box-shadow: none;
    clip-path: polygon(0 0, 100% 0, 100% 60%, 50% 100%, 0 60%);
}

.pillar-disc .sheet-input {
    width: 18mm;
    height: 18mm;
    padding: 0;
    font-family: var(--card-title-font);
    font-weight: var(--card-title-weight);
    font-size: 15pt;
    line-height: 18mm;
    text-align: center;
    color: var(--card-accent);
    background: transparent;
    box-shadow: inset 0 0 0 0.3mm var(--card-rule);
    border-radius: 50%;
}

.pillar-speeds {
    display: flex;
    gap: 3mm;
    padding-bottom: 1mm;
}

.pillar-speeds .sheet-slot {
    flex: 1;
}

.pillar-speeds .sheet-input {
    text-align: center;
}

.pillar-vitals {
    display: flex;
    gap: 3mm;
    align-items: end;
}

.pillar-vitals .sheet-slot {
    width: 15mm;
    flex: none;
}

.pillar-vitals .hit-points {
    width: 20mm;
}

.pillar-vitals .hit-points .sheet-input {
    font-family: var(--card-title-font);
    font-weight: var(--card-title-weight);
    font-size: 15pt;
    text-align: center;
    color: var(--card-accent);
}

.pillar-vitals .temporary-hit-points {
    width: 17mm;
}

.pillar-vitals .hit-die {
    width: 13mm;
}

.pillar-vitals .hit-dice-count {
    width: 17mm;
}

.pillar-vitals .conditions {
    width: auto;
    flex: 1;
}

.pillar-vitals .sheet-input {
    text-align: center;
}

.pillar-main .damage-log {
    flex: none;
    height: 24mm;
    margin-bottom: 3mm;
}

.pillar-main .sheet-area {
    flex: 1;
}

/* ---------- page two ---------- */

.pillar-purse {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9mm;
    padding-top: 5mm;
}

.pillar-purse .coin {
    flex-direction: column-reverse;
    align-items: center;
    gap: 1.2mm;
}

.pillar-purse .coin .sheet-input {
    width: 24mm;
    height: 24mm;
    padding: 0;
    font-size: 12pt;
    line-height: 24mm;
    text-align: center;
    border-radius: 50%;
    box-shadow: inset 0 0 0 0.3mm var(--card-rule), inset 0 0 0 1.4mm var(--card-accent-soft);
}

.pillar-spine .attunement {
    margin-top: auto;
}

.pillar-spine .attunement-slots {
    flex-direction: column;
    gap: 2.4mm;
}

.pillar-store-wide {
    flex: 2;
}

/* ---------- page three ---------- */

.pillar-spell-slots {
    display: flex;
    flex-direction: column;
    gap: 6mm;
    padding-top: 3mm;
}

.pillar-spell-slots .spell-slot {
    gap: 1.6mm;
}

.pillar-spell-slots .spell-slot-level {
    width: 9mm;
    height: 9mm;
    font-size: 12pt;
    line-height: 9mm;
    border-radius: 50%;
    background: var(--card-surface);
}

.pillar-spell-slots .spell-slot-total {
    width: 9mm;
}

.pillar-spell-slots .spell-slot-total .sheet-input {
    height: 9mm;
    padding: 0;
    line-height: 9mm;
    border-radius: 50%;
}

.pillar-spell-slots .spell-slot-expended .sheet-input {
    height: 13mm;
}

.pillar-casting {
    display: flex;
    flex-direction: column;
    gap: 3mm;
    padding-top: 2mm;
}

.pillar-main .spell-table-head,
.pillar-main .spell-row {
    grid-template-columns: 10mm 32mm 1fr;
}
