.fortune_card {
    position: relative;
    height: calc(var(--card_scale));
    width: calc(var(--card_scale) * 2241 / 3840);
    filter: drop-shadow(rgba(0, 0, 0, 0.6) 0 0.1em 0.1em);
    aspect-ratio: 2241 / 3840;
    color: white;
    font-family: var(--lin-libertine);
    text-shadow: var(--text-outline);
}

.fortune_card:hover {
    z-index: 2;
}

.fortune_card div {
    width: 100%;
    height: 100%;
}

.fortune_card>div,
.fortune_card>div>div {
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(0deg) rotateY(0deg) scale3d(1, 1, 1);
}

.fortune_card:not(.hover)>div,
.fortune_card:not(.hover)>div>div {
    transition: transform 1000ms cubic-bezier(0.03, 0.98, 0.52, 0.99), filter 1000ms cubic-bezier(0.03, 0.98, 0.52, 0.99);
}

.fortune_card>div {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    will-change: transform;
}

.fortune_card>div>div {
    position: relative;
    will-change: transform, filter;
}

.fortune_card>div>div div {
    position: absolute;
    top: 0;
    left: 0;
}

.fortune_card .layout,
.fortune_card .card_back {
    background-color: black;
    border-radius: .22em;
    overflow: hidden;
}

.fortune_card .content {
    transform-style: preserve-3d;
    transition: transform 500ms cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
}

.fortune_card .content>* {
    backface-visibility: hidden;
    pointer-events: none;
}

.fortune_card .card_back {
    background: black none no-repeat center center;
    background-image: url('../assets/gui/card/card_back.jpg');
    background-size: cover;
    border: 0.25em solid black;
    transform: rotateY(180deg);
}

.fortune_card.description.fullart .content>.layout {
    background-color: black;
    -webkit-mask-image: url('../assets/gui/card/fullart_mask.webp');
    mask-image: url('../assets/gui/card/fullart_mask.webp');
    mask-repeat: no-repeat;
    mask-size: cover;
    mask-composite: add;
}

.fortune_card.description.fullart.die .content>.layout {
    -webkit-mask-image: url('../assets/gui/card/fullart_mask.webp'), url('../assets/gui/card/fullart_mask_die.webp');
    mask-image: url('../assets/gui/card/fullart_mask.webp'), url('../assets/gui/card/fullart_mask_die.webp');
}

.fortune_card.description.fullart.miniboss .content>.layout {
    -webkit-mask-image: url('../assets/gui/card/fullart_mask.webp'), url('../assets/gui/card/fullart_mask_miniboss.webp');
    mask-image: url('../assets/gui/card/fullart_mask.webp'), url('../assets/gui/card/fullart_mask_miniboss.webp');
}

.fortune_card.description.fullart.boss .content>.layout {
    -webkit-mask-image: url('../assets/gui/card/fullart_mask.webp'), url('../assets/gui/card/fullart_mask_boss.webp');
    mask-image: url('../assets/gui/card/fullart_mask.webp'), url('../assets/gui/card/fullart_mask_boss.webp');
}

.fortune_card .fullart {
    left: 0;
    top: 9.5573%;
    bottom: 26.7701%;
    height: auto;
    background: black none no-repeat center center;
    background-size: cover;
}

.fortune_card .hero {
    position: absolute;
    top: 0;
    left: 16.2874%;
    right: 16.2874%;
    width: auto;
    background: transparent none no-repeat center center;
    background-size: contain;
}

.fortune_card.description .hero {
    top: 13.125%;
    height: auto;
    aspect-ratio: 1;
}

.fortune_card .background {
    background: black none no-repeat center center;
    background-size: cover;
    -webkit-mask-image: url('../assets/gui/card/card_mask2.webp');
    mask-image: url('../assets/gui/card/card_mask2.webp');
    mask-size: 100%;
}

.fortune_card.fullart .background:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 40%;
    background-color: black;
}

.fortune_card.rank .background {
    -webkit-mask-image: url('../assets/gui/card/card_mask3.webp');
    mask-image: url('../assets/gui/card/card_mask3.webp');
}

.fortune_card .frame {
    background: transparent none no-repeat center center;
    background-size: cover;
}

.fortune_card .text>* {
    position: absolute;
    font-size: 0.4em;
    width: auto;
    height: auto;
}

.fortune_card:not(.name) .text>.name,
.fortune_card:not(.label) .text>.label,
.fortune_card:not(.rank) .text>.rank,
.fortune_card:not(.description) .text>.description {
    display: none !important;
}

.fortune_card .text>.description {
    display: -webkit-box;
    top: 81.5674%;
    left: 50%;
    width: max-content;
    max-width: 66%;
    padding: 0 0.25em;
    max-height: 4lh;
    overflow: hidden;
    word-wrap: break-word;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    transform: translate(-50%, -50%);
}

.fortune_card.label .text>.description {
    top: calc(81.5674% - 0.5lh);
    max-height: 3lh;
    -webkit-line-clamp: 3;
    line-clamp: 3;
}

.fortune_card .description>div {
    position: static !important;
    font-size: 0.8em;
}

.fortune_card .text>.name,
.fortune_card .text>.label {
    white-space: nowrap;
}

.fortune_card .text>.name {
    text-align: left;
    top: 6.7383%;
    left: calc(17% + 0.25em);
    right: calc(17% + 0.25em);
    transform: translateY(-50%);
}

.fortune_card.die .text>.name {
    left: calc(29.9582% + 0.25em);
}

.fortune_card.boss .text>.name {
    left: calc(37.9916% + 0.25em);
}

.fortune_card.miniboss .text>.name {
    left: calc(29.7071% + 0.25em);
}

.fortune_card.rank .text>.name {
    left: calc(31.0460% + 0.25em);
}

.fortune_card .text>.label {
    text-align: center;
    top: 93.9941%;
    left: 50%;
    width: calc(66% - 0.5em);
    transform: translate(-50%, -50%);
}

.fortune_card .text>.name>span,
.fortune_card .text>.rank>span,
.fortune_card .text>.label>span {
    width: fit-content;
    transform-origin: left bottom;
}

.fortune_card .rank {
    text-align: center;
    top: 9.9609%;
    left: 16.7364%;
    width: 13.5%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
}

.fortune_card .text>.rank>span {
    font-size: calc(4em * 0.583333);
    transform-origin: left center;
}

#card_details {
    position: absolute;
    transition: transform 100ms ease-out, opacity 100ms linear;
    pointer-events: none;
    z-index: 30 !important;
}

#ability_check .summary,
#card_details {
    color: var(--light);
    width: calc(var(--card_scale) * 3 * 2241 / 3840);
    font-family: var(--lin-libertine);
    font-size: calc(var(--scale) * 1.5);
}

#card_details.inactive {
    opacity: 0;
    transform: scale(0.95);
    transition: transform 100ms ease-in, opacity 100ms linear;
}

#card_details hr {
    border-image-source: linear-gradient(to right, transparent, #666, transparent);
    border-image-slice: 1;
    border-image-width: 1;
}

#ability_check .summary,
#card_details>div {
    padding: 0.5em;
    border-radius: 0.5em;
    border: 2px solid #343434;
    box-shadow: inset 0px 0px 30px 2px rgba(0, 0, 0, 0.5), 0px 0px 3px 0px rgba(0, 0, 0, 0.75);
    background: rgb(13 13 13 / 90%) !important;
    backdrop-filter: blur(0.2em);
}

#card_details>div>div {
    position: relative;
    margin: 0.5em 0;
    padding-left: 1.5em;
}

#ability_check .summary .label,
#card_details .card_name {
    margin: 0.5em 0 1em !important;
}

#card_details>div>div:last-child {
    margin-bottom: 0;
}

#card_details .description:first-child,
#card_details .tag:first-child {
    margin-top: 0;
}

#ability_check .summary .label>*,
#card_details .card_name>* {
    font-size: 1.5em;
    color: var(--orange) !important;
}

#card_details span.rank:not(:empty):before {
    content: " ";
}

#card_details .description p {
    margin-block-start: 0.5em;
    margin-block-end: 0.5em;
}

#card_details .description span,
.fortune_card .text>.description span {
    color: var(--pure);
}

#card_details span.lust,
.fortune_card .text>.description span.lust {
    color: var(--yellow);
}

#card_details span.sex,
.fortune_card .text>.description span.sex {
    color: var(--sexy);
}

#card_details .description:before,
#card_details .tag:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 1em;
    height: 1.25em;
    background: transparent url('../assets/gui/symbol_star.svg') no-repeat center center;
    background-size: 70% auto;
    filter: brightness(86%);
}

#card_details .spell:before {
    background-image: url('../assets/gui/symbol_shooting_star.svg');
    background-size: contain;
}

#card_details .tag.card_slot:before,
#card_details .description:before {
    background-image: url('../assets/gui/symbol_card.svg');
    background-size: 70% auto;
}

#card_details .secret_phrase,
#card_details .flavor_text {
    font-style: italic;
    color: var(--orange);
}

#card_details .card_name:empty,
#card_details .description:empty {
    display: none;
}

#card_details .tag.author:before,
#card_details .tag.artist:before {
    background-image: url('../assets/gui/symbol_brush.svg');
    background-size: 70% auto;
}

#card_details .tag.author:before {
    background-image: url('../assets/gui/symbol_pencil.svg');
}

#card_details .tag.artist.author:before {
    background-image: url('../assets/gui/symbol_pencil_brush.svg');
}

#card_details .tag.challenge:before {
    background-image: url('../assets/gui/symbol_combat.svg');
}

#card_details .tag table tr th:first-child,
#card_details .tag table tr td:first-child {
    padding-right: 1em;
}

#card_details .tag table tr th {
    text-align: left;
    font-weight: normal;
}

#card_details .tag table tr th,
#card_details .tag>div:first-child {
    color: var(--orange);
}

#ability_check .summary .label,
#card_details>.ability>div:first-child {
    position: relative;
    text-align: center;
    padding: 0.2em !important;
    background: var(--pure);
    border-radius: 3px;
    box-shadow: 0px 0px 3px 0px rgb(0 0 0 / 75%);
}

#ability_check.tough .summary .label,
#card_details>.ability.tough>div:first-child {
    background: var(--tough);
}

#ability_check.curious .summary .label,
#card_details>.ability.curious>div:first-child {
    background: var(--curious);
}

#ability_check.cunning .summary .label,
#card_details>.ability.cunning>div:first-child {
    background: var(--cunning);
}

#ability_check.sexy .summary .label,
#card_details>.ability.sexy>div:first-child {
    background: var(--sexy);
}

#ability_check .summary .label>span,
#card_details>.ability>div:first-child>span {
    color: black !important;
    font-family: var(--ubuntu);
}

#ability_check .summary table,
#card_details>.ability .bonuses {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    font-family: var(--ubuntu);
    border-radius: .3em;
}

#ability_check .summary table>tr:first-child>td,
#card_details>.ability .bonuses>tr:first-child>td {
    padding-top: 0.25em;
}

#ability_check .summary table>tr:last-child>td,
#card_details>.ability .bonuses>tr:last-child>td {
    padding-bottom: 0.25em;
}

#ability_check .summary table>tr>td:first-child,
#card_details>.ability .bonuses>tr>td:first-child {
    width: 1.5em;
    text-align: right;
}

#ability_check .summary table>tr:not(.penalty)>td:first-child,
#card_details>.ability .bonuses>tr:not(.penalty)>td:first-child {
    color: var(--dark);
}

#ability_check .summary table>tr.active>td:first-child,
#card_details>.ability .bonuses>tr.active>td:first-child {
    color: var(--green);
}

#ability_check .summary table>tr.penalty,
#card_details>.ability .bonuses>tr.penalty {
    color: var(--red);
}

#ability_check .summary table>tr>td:nth-child(2),
#card_details>.ability .bonuses>tr>td:nth-child(2) {
    padding-left: 0.5em;
}

#card_details .hint {
    font-style: italic;
    color: #999;
    font-size: 0.8em;
    text-align: center;
}

#card_details .hint:before {
    content: "(";
}

#card_details .hint:after {
    content: ")";
}

#card_tooltip {
    position: absolute;
    pointer-events: none;
}

#card_tooltip * {
    pointer-events: none !important;
}

#card_tooltip.inactive {
    display: none;
}