@font-face {
    font-family: "nyala";
    src: url("../assets/nyala.ttf")
}

@font-face {
    font-family: "tnn";
    src: url("../assets/tnn.ttf")
}

/* mobile resolution */
@media (max-width: 991.98px) {
    html {
        line-height: 0;
    }

    .main-content {
        padding-top: 2.5vh;
    }
}

/* desktop resolution */
@media (min-width: 992px) {
    html {
        line-height: 0;
    }

    p {
        margin-bottom: 0;
    }
}

/* FHD */
@media (max-width: 1920px) {
    #race-img {
        max-height: 26vh;
    }
}

/* QHD */
@media (min-width: 1921px) {
    #race-img {
        max-height: 30vh;
    }
}

/* variables */
:root {
    --color: 255 0 0;

    --pink: 255 170 221;
    --lavender: 221 170 255;
    --blue: 189 214 255;
    --black: 32 32 32;
    --white: 239 239 239;

    --fontsize: 1vw;

    --bg-opac: 0.2;
    --rad: 0.8rem;
}

.pink {--color: var(--pink)}
.lavender {--color: var(--lavender)}
.blue {--color: var(--blue)}
.white {--color: var(--white)}
.black {--color: var(--black)}

.no-opac {--bg-opac: 0}
.low-opac {--bg-opac: 0.1}
.mid-opac {--bg-opac: 0.2}
.high-opac {--bg-opac: 0.4}
.full-opac {--bg-opac: 1}

.rad-none {--rad: 0}
.rad-sm {--rad: 0.4rem}
.rad-md {--rad: 0.8rem}
.rad-lg {--rad: 1.2rem}

/* site defaults */

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    background: #222428;

    font-family: "Liberation Serif", serif;
    letter-spacing: 0.5px;
}

/* page background gradient */
body::before,
body::after { 
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 40rem;
    pointer-events: none;
    z-index: -1;

    @media (max-width: 991.98px) {
        display: none;
    }
}

body::before {
    top: 0;
    background: linear-gradient(to bottom, #533447, transparent);
}

body::after {
    bottom: 0;
    background: linear-gradient(to top, #3C4451, transparent);
}

.page {
    height: 100vh;
    display: grid;
    grid-template-rows: auto auto 1fr;
}

ul {
    list-style-type: "–  ";
}

a {
    text-decoration: none;
    color: inherit;
}

b {
    font-weight: 800;
}

data {
    display: none;
}

/* font sizes */
.xlg, h1 {font-size: 36px}
.lg, button.accordion-button {font-size: 24px}
.md {font-size: 20px}
.sm {font-size: 17px}
.xsm {font-size: 14px}

@media (max-width: 991.98px) {
    .xlg, h1 {font-size: 64px}
    .lg, button.accordion-button {font-size: 54px}
    .md {font-size: 40px}
    .sm {font-size: 36px}
    .xsm {font-size: 28px}
}

.title {
    text-align: center;
}

.main-content {
    padding-top: 2.5vh;
    overflow: auto;

    margin: 0;
}

.main-content > .box {
    padding: 1.5rem;
    margin: auto;
    margin-top: 0;
}

.box {
    color: rgb(var(--white));
    background: rgb(var(--color) / var(--bg-opac));
    border: 1px solid rgb(var(--color));
    border-radius: var(--rad);
}

.hide {
    display: none;
}

.top {
    z-index: 1000;
}

.row.no-margin {
    margin: 0;
}

.txt {
    line-height: 160%;

    @media (max-width: 991.98px) {
        line-height: 180%;
    }
}

.txt:not(:first-of-type) {
    margin-top: 1rem;
    text-indent: 1rem;
}

.txt-2 {
    opacity: 0.6;
}

.mobile {
    @media (min-width: 992px) {
        display: none;
    }
}

/* navbars for top and bottom of screen */

header {
    display: flex;
    align-items: center;
    height: 4rem;
    background-color: rgb(var(--color) / 0.2);
    border-bottom: 1px solid rgb(var(--color));
    padding: 0 3%;

    color: rgb(var(--color));
}

.navbar {
    display: grid;
    grid-template-columns: 40% 60%;
}

.navbar-toggler-icon {
    filter: invert(1);
}

hr.black {
    color: rgb(var(--black));
}

/* general button */

button {
    cursor: pointer;

    background-color: rgb(var(--color) / var(--bg-opac));
    border: 1px solid rgb(var(--color));
    border-radius: 0.8rem;
    transition: 0.5s ease-in-out;

    color: rgb(var(--color));
    text-decoration: none;
    text-align: center;
}

button.sm {padding: 0.25rem 0.5rem;}
button.md {padding: 0.5rem 1rem;}

button:hover {
    --bg-opac: 0.8;
    color: rgb(var(--black));
    transition: 0.05s ease-in-out;
}

button.active,
button.pos {
    --bg-opac: 1;
    color: rgb(var(--black));
    transition: 0.2s ease-in-out;
}

button.expand {
    display: grid;
    grid-template-columns: auto;
    justify-content: center;
    align-items: center;

    height: auto;
    width: 100%;
    padding: 1rem;

    border-radius: 0;

    text-align: left;
}

button.expand:first-of-type {
    border-top-left-radius: var(--rad);
    border-top-right-radius: var(--rad);
}
button.expand:last-of-type {
    border-bottom-left-radius: var(--rad);
    border-bottom-right-radius: var(--rad);
}
button.expand:not(:last-of-type),
button.list:not(:last-of-type) {
    border-bottom: none;
}
div.expand {
    padding: 1rem 2rem;

    ul {
        margin: 0;
    }
}

/* item list view button */
button.list {
    display: grid;
    align-items: center;
    text-align: left;

    width: 100%;
    line-height: normal;
    user-select: none;
    padding: 5px 1rem;

    border-radius: 0;
    border-collapse: collapse;

    outline: none;
    box-shadow: none;

    color: rgb(var(--white));

    @media (max-width: 991.98px) {
        height: 90px;
        padding: 3px 1.5rem;
    }
}

/* spell display level viewer */
.button-lvl {
    cursor: pointer;
    padding: 0.5rem 1rem;
    margin: 0;
    flex: 1;
    user-select: none;

    background-color: rgb(var(--color) / var(--bg-opac));
    border: 1px solid rgb(var(--color));
    transition: 0.5s ease-in-out;

    color: rgb(var(--color));
    text-decoration: none;
    text-align: center;
}

button.lvl:first-of-type {
    border-top-left-radius: var(--rad);
    border-bottom-left-radius: var(--rad);
}
button.lvl:last-of-type {
    border-top-right-radius: var(--rad);
    border-bottom-right-radius: var(--rad);
}

.button-lvl:hover {
    background-color: rgb(var(--blue) / 0.8);
    color: rgb(var(--black));
    transition: 0.05s ease-in-out;
}

.button-lvl.active {
    background-color: rgb(var(--blue) / 1);
    color: rgb(var(--black));
    transition: 0.05s ease-in-out;
}

/* toggleable buttons; toggle-1 has 2 states, toggle-2 has 3 states */
.button-toggle,
.button-toggle-2 {
    cursor: pointer;
    user-select: none;

    background-color: rgb(var(--color) / var(--bg-opac));
    border: 1px solid rgb(var(--color));
    border-radius: 0.8rem;
    transition: 0.1s ease-in-out;

    color: rgb(var(--white));
    text-decoration: none;
    text-align: center;

    text-overflow: ellipsis;
}

.button-toggle-2.neg,
.button-toggle-2.neg:hover {
    --color: var(--black) !important;
    color: rgb(var(--white));
}

.button-toggle:hover,
.button-toggle-2:hover,
.button-toggle.pos:hover,
.button-toggle-2.pos:hover {
    --bg-opac: 0.8;
    color: rgb(var(--black));
}

.button-toggle.filter-toggle,
.button-toggle-2.filter-toggle {
    display: flex;
    margin: 2px;
    padding: 5px 12px;

    align-items: center;
    justify-content: center;
}

/* paired buttons that function as a switch; one or the other */
.button-switch {
    padding: 0vw 0.6vw;
    cursor: pointer;
    height: 2rem;

    background-color: rgb(var(--color) / var(--bg-opac));
    border: 1px solid rgb(var(--color));
    border-radius: 0.8rem;
    transition: 0.1s ease-in-out;

    color: rgb(var(--color));
    text-decoration: none;
    text-align: center;
}

.button-switch:first-of-type {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: 0;
}

.button-switch:last-of-type {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: 0;
}

.button-switch.hover {
    background-color: rgb(var(--color) / 0.7);
    color: rgb(var(--black));
}

.button-switch.active {
    background-color: rgb(var(--color)) !important;
    color: rgb(var(--black));
}

/* list view pin button */
.button-pin {
    display: flex;
    justify-content: center;
    align-items: center;

    cursor: pointer;
    height: 3rem;
    width: 3rem;

    background-color: rgb(var(--color) / var(--bg-opac));
    border: 1px solid rgb(var(--color));
    border-radius: 0.8rem;
    transition: 0.1s ease-in-out;

    color: rgb(var(--color));
    text-decoration: none;
}

.button-pin:hover {
    background-color: rgb(var(--color) / 0.7);
    color: rgb(var(--black));
}

.button-pin.active {
    background-color: rgb(var(--color)) !important;
    color: rgb(var(--black));
}

.button-pin #pin {
    height: 2rem;
    width: 2rem;
    filter: invert(1);
    transition: 0.1s ease-in-out;
}

.button-pin:hover #pin,
.button-pin.active #pin {
    filter: invert(0);
    transition: 0.1s ease-in-out;
}

.link {
    color: rgb(var(--color) / 0.7);
    font-size: 0.5vw;
    text-decoration: underline;
}

.link:hover {
    color: rgb(var(--color));
}

.scroll {
    height: 100%;
    overflow-y: auto;
}

div.accordion {
    margin: 0.8rem auto 2rem auto;
    width: 97%;
}

.accordion-button:hover {
    background: rgb(var(--color));
    color: rgb(var(--black));
    transition: 0.2s ease-in-out;
}

.subclass-accordion::after {
    margin-left: 5%;
}

.accordion-item { 
    --bs-accordion-bg: transparent;
    --bs-accordion-border-color: transparent;
    --bs-accordion-active-bg: rgb(var(--color));
    --bs-accordion-active-color: rgb(var(--black));
    background: rgb(var(--color) / 0.2);
    border: 1px solid rgb(var(--color));
    border-radius: 0;

    color: rgb(var(--white));
}

.accordion-item:first-of-type,
.accordion-item:first-of-type > .accordion-header > .accordion-button {
    border-top-right-radius: 0.8rem !important;
    border-top-left-radius: 0.8rem !important;
}

.accordion-item:last-of-type,
.accordion-item:last-of-type > .accordion-header > .accordion-button {
    border-bottom-right-radius: 0.8rem !important;
    border-bottom-left-radius: 0.8rem !important;
}

/* spell slot table */
table.spells {
    border: 2px solid rgb(var(--blue));
    margin: 0.5vw 2vw;

    tr:nth-child(n+2) {
        border-top: 1px solid rgb(var(--blue));
    }

    td, th {
        padding-left: 1vw;
        padding-right: 1vw;
        font-size: 0.9vw;
    }

    td:nth-child(n+2),
    th:nth-child(n+2) {
        border-left: 1px solid rgb(var(--blue));
        background-color: rgb(var(--blue) / 0.25);
        transition: 0.1s ease-in-out;
    }

    td:first-child,
    th:first-child {
        border-right: 2px solid rgb(var(--blue));
    }

    th:nth-child(11),
    td:nth-child(11) {
        border-left: 2px solid rgb(var(--blue));
        text-align: center;
    }

    tr.hover > td:not([rowspan])  {
        background-color: rgb(var(--blue) / 0.6);
        color: rgb(var(--black)) !important;
        transition: 0.1s ease-in-out;
    }

    td:first-child {
        width: 7vw;
        background-color: rgb(var(--blue) / 0.3);
        transition: 0.1s ease-in-out;
    }

    th {
        border-bottom: 2px solid rgb(var(--blue));
        background-color: rgb(var(--blue) / 0.4) !important;
    }

    td:nth-child(n+2):nth-child(-n+10),
    th:nth-child(n+2):nth-child(-n+10) {
        width: 5.7vw;
    }
}

table.spells.half {
    td:nth-child(n+7):nth-child(-n+10),
    th:nth-child(n+7):nth-child(-n+10) {
        background-color: rgb(var(--blue) / 0.1) !important;
    }

    tr.hover > td:nth-child(n+7):nth-child(-n+10) {
        background-color: rgb(var(--blue) / 0.3) !important;
    }
}

table.spells.third {
    td:nth-child(n+6):nth-child(-n+10),
    th:nth-child(n+6):nth-child(-n+10) {
        background-color: rgb(var(--blue) / 0.1) !important;
    }

    tr.hover > td:nth-child(n+6):nth-child(-n+10) {
        background-color: rgb(var(--blue) / 0.3) !important;
    }
}

/* ability tables */
table.ability {
    width: 100%;
    border: 1px solid rgb(var(--blue));
    margin-top: 0.4vw;
    margin-bottom: 0.4vw;

    tr {
        border-top: 1px solid rgb(var(--blue));
    }

    td, th {
        padding: 0 0.5rem;
    }

    th {
        background-color: rgb(var(--blue) / 0.3);
    }

    td:not(:first-child),
    th:not(:first-child) {
        border-left: 1px solid rgb(var(--blue));
    }
}

#select-view {
    height: 95%;
    padding: 0;

    margin-right: auto;
    margin-left: auto;

    @media (max-width: 991.98px) {
        height: auto;
    }
}

#spell-preview {
    background: #222428;

    transform: scale(0.8);
    transform-origin: top left;
    position: fixed;

    max-height: 60%;
    max-width: 60%;
    height: auto;

    padding: 0;
    margin: 0;
    z-index: 1100;

    color: rgb(var(--white));
    overflow-y: auto;

    display: none;
}

#spell-preview,
.statblock-preview > div {
    border: 3px solid rgb(var(--pink));
    border-radius: 0.8rem;
}

#spell-preview-content,
#spell-preview-content > div {
    border: none;
    height: 100%;
}

.spell-link:hover {
    color: rgb(var(--pink));
}

#select-collapse {
    height: 100%;
}

#select-select {
    position: relative;
    padding: 0 5px 5px 5px;

    margin: 0;
    height: 100%;

    display: grid;
    grid-template-rows: auto 1fr;
}

#select-search {
    display: flex;
    align-items: center;
    height: auto;
    
    width: 85%;
    padding: 0.5rem 0;
    margin: auto;
    align-items: center;


    input {
        color: rgb(var(--blue));
        background: rgb(var(--black) / 0.5);
        border: 1px solid rgb(var(--blue));
        border-radius: 1rem;
    }
}

#select-search > * {
    padding: 0;
    margin: 0 1rem;
}

#select-searchbar {
    width: 100%;
    height: 2rem;

    position: relative;
    display: flex;
    align-items: center;

    @media (max-width: 991.98px) {
        height: 40px;
    }
}

#searchbar {
    position: absolute;

    height: 100%;
    width: 100%;

    padding: 0 1rem;
    line-height: normal;
}

#clear-button {
    position: absolute;
    right: 0.6rem;

    cursor: pointer;
}

#select-filter {
    position: absolute;

    background-color: #956881;

    margin: 0 0 0 0;
    padding: 2.5%;
    z-index: 10;
    justify-content: center;

    max-height: 100%;
    display: none;

    hr {
        margin-right: auto;
        margin-left: auto;
        margin-top: 1rem;
        margin-bottom: 0.5rem;
        width: 80%;
    }

    #close, #clear {
        padding: auto;
        margin: 0;
    }
}

.select-filter-option {
    justify-content: center;
    margin: 0;

    div {
        justify-content: center;
    }
}

#filter-button {
    margin: 0;
    padding: 5px 10px;
    line-height: normal;
}

#select-list {
    display: grid;
    grid-template-rows: auto 1fr;

    border: 2px solid rgb(var(--color));
    border-radius: var(--rad);
    margin: 0;
}

#pinned {
    padding: 0;
    margin: 0;
}

#pinned > .button-list.active,
#pinned > .button-list:hover {
    color: rgb(var(--black)) !important;

    img {
        filter: invert(0);
    }
}

#unpinned {
    padding: 0;
    margin: 0;
}

#select-box {
    padding: 0;
    font-weight: lighter;

    @media (min-width: 992px) {
        height: 100%;
        overflow-y: auto;
    }
}

#select-display {
    padding: 1rem;
    height: auto;

    h1 {
        margin: 0;
    }

    hr {
        margin: 0.5rem;
    }

    ul {
        margin: 0;
        margin-left: 5%;
        width: 95%;
    }
}

#select-display > div {
    align-items: center;

    margin-left: auto;
    margin-right: auto;

    padding: 1rem;
}

#select-display > div:first-of-type {
    padding: 0 1rem 1rem 1rem;
}

#select-display > div:last-of-type {
    padding: 1rem 1rem 0 1rem;
}

#select-header {
    margin-top: 0.5rem;
}

#select-header * {
    padding: 0;
}

#select-header div > * {
    padding: 0;
    margin: 0 0.75rem;
}

#select-header > div:first-of-type {
    margin-bottom: 0.5rem;
}

#select-desc {
    padding: 1rem;
}

.horizontal-menu.show {
    display: flex;
    flex-direction: row;
    min-width: unset;
}

.indent-li {
    ul {
        width: 95%;
        margin-left: 5%;
    }
}

.subrace > p:not(:first-of-type) {
    margin-top: 1rem;
}

#stats {    
    padding: 0.5rem;
}

#stats > div {
    padding: 0.2rem 0 0.5rem 0;
    align-items: center;
}

/* ----- */

/* damage colors */

.fire-dmg {color: #FF3300;}
.cold-dmg {color: #9BC2E6;}
.acid-dmg {color: #DDEE55;}
.poison-dmg {color: #22AA22;}
.lightning-dmg {color: #2222AA;}
.thunder-dmg {color: #FFD966;}
.necrotic-dmg {color: #AE6E52;}
.radiant-dmg {color: #FF9933;}
.psychic-dmg {color: #9777ff;}
.force-dmg {color: #FFAADD;}
.bludgeoning-dmg,
.piercing-dmg,
.slashing-dmg {color: #A0A0A0;}

#item-img {
    height: auto;
    width: auto;

    padding: 1rem 0;

    border-radius: 20%;

    max-width: 50%;
    max-height: 40vh;
}

#item-img:hover {
    transform: scale(1.75);
    transform-origin: top right;
    
    padding: 1rem;
    background: rgb(var(--black) / 0.3);

    z-index: 1000;
}

.school-img {
    height: 20px;
    width: auto;

    filter: invert(1);
}

#rc-menu {
    width: auto;
    height: auto;

    background: rgb(var(--black));
    padding: 0;

    display: none;
    z-index: 1100;
}

#rc-menu > div {
    margin: 0;
    margin-right: auto;
    margin-left: auto;

    display: flex;
    flex-direction: column;

    border: 1px solid rgb(var(--color));
    border-radius: var(--rad);
}

.button-rc {
    cursor: pointer;
    border-radius: 0;
    width: 100%;

    display: flex;
    align-items: center;

    padding: 0.2rem 1rem;
    margin: 0;

    background: rgb(var(--color) / var(--bg-opac));
    transition: 0.2s ease-in;
}

.button-rc:hover {
    --bg-opac: 0.8;
    color: rgb(var(--black));
    transition: 0.1s ease-in;
}

.button-rc:focus {
    --bg-opac: 1;
    transition: 0.1s ease-in;
}

.button-rc:not(:first-of-type) {
    border-top: 1px solid rgb(var(--color));
}

#vp {
    display: none;
    z-index: 1101;
}

#vp-txt {
    color: rgb(var(--black)) !important;
    margin: 5px 10px;
}