/*
 * Astrolabe: everything turns about a round portrait. Three abilities arc down
 * each side of it, their skills fanning outward, combat sits above the hub and
 * vitals below; on the spell page the nine slot levels rise in an arch.
 */

.astrolabe-page {
    display: flex;
    flex-direction: column;
    gap: 5mm;
}

.astrolabe-page .sheet-toggle-mark {
    border: none;
    transform: none;
    background: var(--card-accent);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpolygon points='10,1.2 17.6,5.6 17.6,14.4 10,18.8 2.4,14.4 2.4,5.6' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpolygon points='10,1.2 17.6,5.6 17.6,14.4 10,18.8 2.4,14.4 2.4,5.6' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.astrolabe-page .sheet-toggle-input:checked + .sheet-toggle-mark {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpolygon points='10,1.2 17.6,5.6 17.6,14.4 10,18.8 2.4,14.4 2.4,5.6' fill='%23000'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpolygon points='10,1.2 17.6,5.6 17.6,14.4 10,18.8 2.4,14.4 2.4,5.6' fill='%23000'/%3E%3C/svg%3E");
}

/* ---------- centred header ---------- */

.astrolabe-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.4mm;
}

.astrolabe-header .banner-name {
    width: 130mm;
}

.astrolabe-header .banner-name .sheet-input {
    text-align: center;
}

.astrolabe-identity,
.astrolabe-purse,
.astrolabe-casting {
    display: flex;
    justify-content: center;
    gap: 4mm;
}

.astrolabe-identity .sheet-slot { width: 26mm; }
.astrolabe-identity .identity-level { width: 11mm; }
.astrolabe-identity .sheet-slot-label,
.astrolabe-casting .sheet-slot-label {
    text-align: center;
}
.astrolabe-identity .sheet-input,
.astrolabe-casting .sheet-input {
    text-align: center;
}

/* ---------- the wheel ---------- */

.astrolabe-wheel {
    display: grid;
    grid-template-columns: 1fr 54mm 1fr;
    column-gap: 3mm;
    align-items: stretch;
}

.astrolabe-arc {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3mm;
    min-width: 0;
}

.astrolabe-arc .ability-block {
    display: flex;
    align-items: center;
    gap: 2mm;
    min-width: 0;
}

.astrolabe-arc-left .ability-block {
    flex-direction: row-reverse;
}

.astrolabe-arc-left .ability-block:nth-child(2) {
    padding-right: 5mm;
}

.astrolabe-arc-right .ability-block:nth-child(2) {
    padding-left: 5mm;
}

.astrolabe-roundel {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    gap: 1.2mm;
    width: 20mm;
}

.astrolabe-roundel .ability-name {
    font-family: var(--card-label-font);
    font-size: 5.6pt;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.astrolabe-roundel .ability-modifier .sheet-input {
    width: 16mm;
    height: 16mm;
    padding: 0;
    font-size: 17pt;
    line-height: 16mm;
    border-radius: 50%;
    box-shadow: inset 0 0 0 0.3mm var(--card-rule), inset 0 0 0 1.1mm transparent, inset 0 0 0 1.35mm var(--card-rule);
}

.astrolabe-roundel-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1mm;
}

.astrolabe-roundel-foot .ability-score {
    width: 8mm;
}

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

.astrolabe-roundel-foot .ability-save {
    gap: 1mm;
}

.astrolabe-roundel-foot .ability-save-value {
    width: 8mm;
}

.astrolabe-roundel-foot .ability-save-value .sheet-input {
    height: 8mm;
    padding: 0;
    line-height: 8mm;
    border-radius: 50%;
}

.astrolabe-arc .skill-list {
    flex: 1;
    gap: 1.2mm;
}

.astrolabe-arc .sheet-toggle,
.astrolabe-arc .sheet-toggle-mark {
    width: 3mm;
    height: 3mm;
}

.astrolabe-arc .skill-marks {
    gap: 0.6mm;
}

.astrolabe-arc .skill-row {
    gap: 1mm;
}

.astrolabe-arc .skill-modifier {
    width: 7mm;
}

.astrolabe-arc .skill-name {
    font-size: 7.2pt;
}

.astrolabe-arc-left .skill-row {
    flex-direction: row-reverse;
}

.astrolabe-arc-left .skill-name {
    text-align: right;
}

.astrolabe-arc .ability-aside {
    flex: 1;
    gap: 2.4mm;
}

.astrolabe-arc .aside-slot .sheet-input {
    width: 12mm;
    border-radius: 2mm;
}

.astrolabe-hub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 3mm;
}

.astrolabe-combat {
    display: flex;
    gap: 6mm;
}

.astrolabe-disc .sheet-slot-label {
    text-align: center;
}

.astrolabe-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);
    border-radius: 50%;
    box-shadow: inset 0 0 0 0.3mm var(--card-rule);
}

.astrolabe-speeds {
    display: flex;
    gap: 2mm;
    width: 100%;
}

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

.astrolabe-speeds .sheet-slot-label,
.astrolabe-speeds .sheet-input {
    text-align: center;
}

.astrolabe-hub .sheet-portrait {
    position: relative;
    margin: 4mm 0;
}

/* The graduated ring of the instrument: a tick every ten degrees. */
.astrolabe-hub .sheet-portrait::before {
    content: "";
    position: absolute;
    inset: -4.6mm;
    border-radius: 50%;
    background: repeating-conic-gradient(from -0.6deg, var(--card-rule) 0deg 1.2deg, transparent 1.2deg 10deg);
    -webkit-mask: radial-gradient(circle, transparent 26.2mm, #000 26.3mm);
    mask: radial-gradient(circle, transparent 26.2mm, #000 26.3mm);
    pointer-events: none;
}

.astrolabe-page .sheet-portrait-frame {
    width: 48mm;
    height: 48mm;
    border-radius: 50%;
    box-shadow: 0 0 0 1.2mm var(--card-surface), 0 0 0 1.5mm var(--card-rule);
}

.astrolabe-hub .inspiration {
    justify-content: center;
}

/* ---------- vitals band and notes ---------- */

.astrolabe-vitals {
    display: grid;
    grid-template-columns: 1fr 64mm;
    column-gap: 6mm;
    align-items: end;
}

.astrolabe-vital-fields {
    display: flex;
    gap: 3mm;
    align-items: end;
}

.astrolabe-vital-fields .sheet-slot {
    width: 17mm;
    flex: none;
}

.astrolabe-vital-fields .hit-points {
    width: 22mm;
}

.astrolabe-vital-fields .hit-points .sheet-input {
    font-family: var(--card-title-font);
    font-weight: var(--card-title-weight);
    font-size: 15pt;
    color: var(--card-accent);
}

.astrolabe-vital-fields .hit-dice-count {
    width: 18mm;
}

.astrolabe-vital-fields .conditions {
    width: auto;
    flex: 1;
}

.astrolabe-vital-fields .sheet-input {
    text-align: center;
}

.astrolabe-vitals .damage-log {
    height: 22mm;
}

.astrolabe-notes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6mm;
    flex: 1;
    min-height: 0;
}

.astrolabe-page .sheet-area-title {
    text-align: center;
}

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

.astrolabe-purse {
    gap: 8mm;
}

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

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

.astrolabe-stores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6mm;
    flex: 1;
    min-height: 0;
}

.astrolabe-page .attunement {
    align-items: center;
    padding: 2mm 0;
}

.astrolabe-page .attunement-slots {
    width: 100%;
    gap: 8mm;
}

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

.astrolabe-arch {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    column-gap: 2mm;
    align-items: start;
    padding-top: 1mm;
}

.astrolabe-arch .spell-slot {
    flex-direction: column;
    gap: 1.4mm;
}

.astrolabe-arch .spell-slot:nth-child(1),
.astrolabe-arch .spell-slot:nth-child(9) { margin-top: 10mm; }
.astrolabe-arch .spell-slot:nth-child(2),
.astrolabe-arch .spell-slot:nth-child(8) { margin-top: 6mm; }
.astrolabe-arch .spell-slot:nth-child(3),
.astrolabe-arch .spell-slot:nth-child(7) { margin-top: 3mm; }
.astrolabe-arch .spell-slot:nth-child(4),
.astrolabe-arch .spell-slot:nth-child(6) { margin-top: 1mm; }

.astrolabe-arch .spell-slot-level {
    width: auto;
    font-size: 12pt;
}

.astrolabe-arch .spell-slot-total {
    width: 12mm;
}

.astrolabe-arch .spell-slot-total .sheet-input {
    height: 12mm;
    padding: 0;
    font-size: 11pt;
    line-height: 12mm;
    border-radius: 50%;
}

.astrolabe-arch .spell-slot-expended {
    width: 100%;
    flex: none;
}

.astrolabe-arch .spell-slot-expended .sheet-input {
    text-align: center;
}

.astrolabe-casting .casting-ability { width: 34mm; }
.astrolabe-casting .casting-save,
.astrolabe-casting .casting-attack { width: 18mm; }

.astrolabe-page .spell-table-head span:first-child,
.astrolabe-page .spell-cell-level .sheet-input {
    text-align: center;
}
