div.spell {
    margin-top: 2rem;
    position: relative;
}

div.spell h5 {
    font-size: 1.2em;
    color: var(--md-primary-fg-color);
    border-bottom: 1px solid var(--md-primary-fg-color);
    margin-left: 8px;
    line-height: 1em;
    margin-bottom: 0;
    text-transform: none;
}

div.spell h5 + p {
    margin-top: 0.5em !important;
}

/** 
    Spell Stats
*/

.spell-stats {
    position: absolute;
    top: -1em;
    right: 0;
    display: inline-block;
}

h3.skill .spell-icons-tray {
    position: relative;
    display: block;
}

h3.skill .spell-icons-tray {
    position: absolute;
    bottom: -0.6em;
    right: 0;
    display: inline-block;
    z-index: 1;
    font-size: 16px;
}

.spell-stats div.chain-limit {
    display: inline-block;
    font-family: var(--mono-font-family);
    font-size: 1em;
    font-weight: 600;
    position: relative;
    top: -0.25em;
    margin-right: 0.5rem;
}

.spell-stats div.chain-limit label {
    display: inline-block;
    font-size: 0.8em;
    font-weight: normal;
    color: var(--md-primary-fg-color);
    margin-right: 0.5em;
}

.spell-icons-tray {
    display: inline-block;
}

p:has(span.spell-icon) {
    display: inline-block;
}

span.spell-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    padding: 0.25em;
    border-radius: 4px;
    margin-left: 0.25em;
    color: white;
}

span.spell-icon svg {
    fill: white;
}

span.spell-icon.attack {
    background-color: maroon;
}

span.spell-icon.defense {
    background-color: seagreen;
}

span.spell-icon.utility {
    background-color: mediumturquoise;
}

span.spell-icon.mental {
    background-color: blueviolet;
}

span.spell-icon.continuable {
    background-color: royalblue;
    border-radius: 1em !important;
}

/** 
    Spell Chain
*/

.spell-chain div {
    display: inline-block;
    font-family: var(--mono-font-family);
    font-size: 0.9em;
    font-weight: 200;
    margin-left: 8px;
    color: var(--md-primary-fg-color);
}

.spell-chain ul {
    margin: 0 0 0 1em !important;
    padding-left: 1em;
    overflow: hidden;
    position: relative;
}

.spell-chain ul::before {
    content: '';
    position: absolute;
    top: -0.9em;
    left: 0;
    height: 100%;
    border-left: var(--md-primary-fg-color) 1px solid;
    opacity: 0.5;
}

.spell-chain ul li {
    list-style: none;
    position: relative;
    margin: 0 0 0 0.25em !important;
    padding: 0;
    line-height: 1.5em;
    font-family: var(--mono-font-family);
    font-weight: normal;
}

.spell-chain ul li a {
    font-family: inherit;
    font-weight: inherit;
}

.spell-chain ul li::before {
    content: '';
    position: absolute;
    display: block;
    left: -1.25em;
    width: 0.5em;
    height: 45%;
    border-bottom: var(--md-primary-fg-color) 1px solid;
    opacity: 0.5;
}

.spell-chain ul li::after {
    content: '';
    position: absolute;
    display: block;
    top: 0.425em;
    left: -0.75em;
    width: 0;
    height: 0;
    border-width: 0.25em 0 0.25em 0.5em;
    border-style: solid;
    border-color: transparent;
    border-left-color: var(--md-primary-fg-color);
    opacity: 0.5;
}
