/* CHARACTER DASHBOARD */

:root {
    --character-card-left: -14px;
    --character-card-top: -15px;
    --character-card-width: 320px;
    --character-card-height: 460px;
}

#characterList {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: visible;
    box-sizing: border-box;
}

.character-section-texture,
.character-section-border {
    position: absolute;
    top: var(--character-card-top);
    left: var(--character-card-left);
    width: var(--character-card-width);
    height: var(--character-card-height);
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.character-section-texture {
    z-index: -2;
    background: linear-gradient(
        180deg,
        rgba(44, 88, 168, 0.95) 0%,
        rgba(16, 43, 92, 0.92) 42%,
        rgba(4, 12, 28, 0.98) 100%
    );
    -webkit-mask: url("UIAssets/Character Card/Texture_1.png") no-repeat center / 100% 100%;
    mask: url("UIAssets/Character Card/Texture_1.png") no-repeat center / 100% 100%;
    opacity: 0.8;
}

.character-section-border {
    z-index: 0;
}

.character-section-border--base {
    background: linear-gradient(
        135deg,
        #0d1832 0%,
        #15325f 45%,
        #31d8ff 100%
    );
    -webkit-mask: url("UIAssets/Character Card/Border.png") no-repeat center / 100% 100%;
    mask: url("UIAssets/Character Card/Border.png") no-repeat center / 100% 100%;
}

.character-section-border--highlight {
    background: linear-gradient(
        135deg,
        #8adfff 0%,
        #4dbdff 50%,
        #1b5fa8 100%
    );
    opacity: 0.9;
    -webkit-mask: url("UIAssets/Character Card/Border_2.png") no-repeat center / 100% 100%;
    mask: url("UIAssets/Character Card/Border_2.png") no-repeat center / 100% 100%;
}

.character-page-navigation,
.character-page-legacy {
    display: none !important;
}

.character-dashboard-page {
    position: relative;
    width: 100%;
    z-index: 1;
}

.character-dashboard-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 52px 0 10px;
    color: #f7f8fc;
    font-family: var(--dashboard-font-family);
}

.character-hero-copy {
    position: absolute;
    top: -6px;
    left: 0;
    right: 0;
    z-index: 2;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
    box-sizing: border-box;
    padding: 5px 9px 0;
}

.character-identity-lockup {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.character-identity-lockup h2 {
    margin: 0;
    max-width: 100%;
    font-size: 21px;
    line-height: 0.95;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.34);
}

.character-level {
    margin: 0;
    font-size: 15px;
    line-height: 1;
    letter-spacing: 0;
    text-transform: none;
    color: rgba(202, 213, 232, 0.82);
    font-weight: 500;
}

.character-rank-lockup {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    overflow: visible;
}

.character-rank-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.22;
    font-style: italic;
    font-weight: 600;
    letter-spacing: 0;
    color: #83dcf3;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.32);
}

.character-rank-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.character-level-counter {
    min-height: 20px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background:
        linear-gradient(180deg, rgba(19, 33, 58, 0.98), rgba(14, 26, 47, 0.98)) padding-box,
        linear-gradient(90deg, rgba(177, 199, 235, 0.92), rgba(97, 122, 166, 0.88)) border-box;
    box-shadow: 0 0 8px rgba(35, 49, 73, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    color: #eaf2ff;
}

.character-arte-counter {
    min-height: 20px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    background:
        linear-gradient(180deg, rgba(19, 33, 58, 0.98), rgba(14, 26, 47, 0.98)) padding-box,
        linear-gradient(90deg, rgba(255, 198, 92, 0.95), rgba(140, 111, 47, 0.9)) border-box;
    box-shadow: 0 0 8px rgba(63, 47, 11, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 11px;
    line-height: 1;
    font-weight: 700;
    color: #f3e1b5;
}

.character-arte-counter img {
    width: 11px;
    height: 11px;
    object-fit: contain;
    image-rendering: pixelated;
}

.character-section-heading {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.character-heading-line {
    width: 86px;
    height: 8px;
    display: block;
    flex: 0 0 auto;
    background: linear-gradient(
        90deg,
        #4ad7ff 0%,
        #114f9f 55%,
        #0a1f4d 100%
    );
    -webkit-mask: url("UIAssets/Character Card/Title_Line.png") no-repeat center / 100% 100%;
    mask: url("UIAssets/Character Card/Title_Line.png") no-repeat center / 100% 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.character-heading-line--left {
    transform: scaleX(-1);
}

.character-heading-line--right {
    transform: none;
}

.character-image-shell {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: -10px;
    position: relative;
    z-index: 1;
    overflow: visible;
}

.character-image-container {
    position: relative;
    width: 109px;
    height: 109px;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    box-sizing: border-box;
    background: transparent;
    clip-path: polygon(11% 0, 89% 0, 100% 11%, 100% 89%, 89% 100%, 11% 100%, 0 89%, 0 11%);
}

.character-portrait-frame {
    position: absolute;
    top: 0;
    left: 50%;
    width: 109px;
    height: 109px;
    transform: translateX(-50%);
    pointer-events: none;
    background: linear-gradient(
        180deg,
        #4ad7ff 0%,
        #114f9f 55%,
        #0a1f4d 100%
    );
    -webkit-mask: url("UIAssets/Character Card/Character_Frame.png") no-repeat center / 100% 100%;
    mask: url("UIAssets/Character Card/Character_Frame.png") no-repeat center / 100% 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    z-index: 2;
}

.character-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

#characterPortraitImage {
    position: relative;
    z-index: 1;
    transform: scale(1.04);
    transform-origin: center;
}

.character-resource-stack {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
}

.character-resource-stack + .character-section-heading {
    margin-top: 8px;
}

.character-resource-card {
    width: calc(100% - 20px);
    margin: 0 auto;
    min-height: 34px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    border: 1px solid rgba(247, 248, 252, 0.25);
    border-radius: 3px;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
    transform: translateX(-3px);
}

.character-resource-card::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(247, 248, 252, 0.08);
    pointer-events: none;
}

.character-resource-card--health {
    background:
        linear-gradient(180deg, rgba(19, 33, 58, 0.98), rgba(14, 26, 47, 0.98)) padding-box,
        linear-gradient(
            90deg,
            rgba(255, 98, 132, 0.96) 0%,
            rgba(255, 98, 132, 0.74) 32%,
            rgba(70, 96, 141, 0.9) 100%
        ) border-box;
    border-color: transparent;
    box-shadow:
        0 0 10px rgba(255, 83, 114, 0.24);
}

.character-resource-card--aura {
    background:
        linear-gradient(180deg, rgba(19, 33, 58, 0.98), rgba(14, 26, 47, 0.98)) padding-box,
        linear-gradient(
            90deg,
            rgba(69, 167, 255, 0.96) 0%,
            rgba(69, 167, 255, 0.72) 32%,
            rgba(70, 96, 141, 0.9) 100%
        ) border-box;
    border-color: transparent;
    box-shadow:
        0 0 10px rgba(56, 171, 255, 0.24);
}

.character-resource-emblem {
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.character-resource-emblem-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.character-resource-emblem img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    image-rendering: pixelated;
}

.character-resource-card--health .character-resource-emblem img {
    filter: drop-shadow(0 0 6px rgba(255, 102, 125, 0.55));
}

.character-resource-card--aura .character-resource-emblem img {
    filter: drop-shadow(0 0 6px rgba(63, 175, 255, 0.55));
}

.character-resource-copy {
    min-width: 58px;
    display: flex;
    align-items: center;
}

.character-resource-label {
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.character-resource-value-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    padding-right: 28px;
}

.character-resource-value {
    min-width: 30px;
    font-size: 22px;
    line-height: 0.9;
    font-weight: 700;
    text-align: right;
}

.dashboard-upgrade-stack {
    position: absolute;
    top: 50%;
    right: -18px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-right: 0;
    z-index: 2;
}

.dashboard-upgrade-button {
    width: 34px;
    height: 26px;
    background: transparent;
    border: none;
    padding: 0;
    color: #f7f8fc;
    cursor: default;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.dashboard-upgrade-arrow {
    --upgrade-inner-top: rgba(19, 33, 58, 0.98);
    --upgrade-inner-bottom: rgba(14, 26, 47, 0.98);
    width: 100%;
    height: 100%;
    border: 1px solid transparent;
    border-radius: 4px;
    background:
        linear-gradient(180deg, var(--upgrade-inner-top), var(--upgrade-inner-bottom)) padding-box,
        var(--upgrade-border-gradient, linear-gradient(90deg, rgba(94, 118, 160, 0.96), rgba(70, 96, 141, 0.9))) border-box;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 8px rgba(5, 14, 29, 0.4);
    transition: background 120ms ease, box-shadow 120ms ease;
}

.dashboard-upgrade-arrow-icon {
    width: 11px;
    height: 11px;
    display: block;
    font-size: 0;
    color: transparent;
    box-sizing: border-box;
    border-top: 3px solid #edf4ff;
    border-left: 3px solid #edf4ff;
    transform: translateY(2px) rotate(45deg);
    filter: drop-shadow(0 0 4px rgba(205, 226, 255, 0.32));
}

.dashboard-upgrade-cost {
    width: 42px;
    height: 15px;
    margin-top: -3px;
    border: 1px solid transparent;
    border-radius: 3px;
    background: linear-gradient(180deg, rgba(18, 32, 56, 0.98), rgba(12, 23, 43, 0.98));
    box-shadow: inset 0 0 0 1px rgba(209, 226, 250, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    gap: 2px;
    padding: 0 2px;
    position: relative;
    z-index: 1;
}

.dashboard-upgrade-cost img {
    width: 11px;
    height: 11px;
    object-fit: contain;
    image-rendering: pixelated;
}

.dashboard-upgrade-cost-value {
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    color: #eaf2ff;
}

.character-resource-card--health {
    --upgrade-border-gradient: linear-gradient(
        90deg,
        rgba(255, 98, 132, 0.96) 0%,
        rgba(255, 98, 132, 0.74) 32%,
        rgba(70, 96, 141, 0.9) 100%
    );
}

.character-resource-card--aura .dashboard-upgrade-cost {
    background:
        linear-gradient(180deg, rgba(19, 33, 58, 0.98), rgba(14, 26, 47, 0.98)) padding-box,
        linear-gradient(
            90deg,
            rgba(69, 167, 255, 0.96) 0%,
            rgba(69, 167, 255, 0.72) 32%,
            rgba(70, 96, 141, 0.9) 100%
        ) border-box;
}

.character-resource-card--health .dashboard-upgrade-cost {
    background:
        linear-gradient(180deg, rgba(19, 33, 58, 0.98), rgba(14, 26, 47, 0.98)) padding-box,
        linear-gradient(
            90deg,
            rgba(255, 98, 132, 0.96) 0%,
            rgba(255, 98, 132, 0.74) 32%,
            rgba(70, 96, 141, 0.9) 100%
        ) border-box;
}

.character-resource-card--aura {
    --upgrade-border-gradient: linear-gradient(
        90deg,
        rgba(69, 167, 255, 0.96) 0%,
        rgba(69, 167, 255, 0.72) 32%,
        rgba(70, 96, 141, 0.9) 100%
    );
}

.dashboard-upgrade-button:focus-visible .dashboard-upgrade-arrow {
    --upgrade-inner-top: rgba(47, 71, 108, 0.98);
    --upgrade-inner-bottom: rgba(35, 56, 88, 0.98);
    box-shadow: 0 0 12px rgba(28, 58, 102, 0.62);
}

@media (hover: hover) and (pointer: fine) {
    .dashboard-upgrade-button:hover .dashboard-upgrade-arrow {
        --upgrade-inner-top: rgba(47, 71, 108, 0.98);
        --upgrade-inner-bottom: rgba(35, 56, 88, 0.98);
        box-shadow: 0 0 12px rgba(28, 58, 102, 0.62);
    }
}

.dashboard-upgrade-button:active .dashboard-upgrade-arrow {
    --upgrade-inner-top: rgba(62, 91, 133, 0.98);
    --upgrade-inner-bottom: rgba(47, 72, 109, 0.98);
    box-shadow: 0 0 14px rgba(36, 72, 122, 0.7);
}

.dashboard-upgrade-button:focus-visible {
    outline: 2px solid rgba(247, 248, 252, 0.8);
    outline-offset: 4px;
}

.character-section-heading {
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.character-ability-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.character-ability-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    height: 136px;
    padding: 6px 4px 24px;
    border: 1px solid rgba(139, 208, 255, 0.26);
    border-radius: 3px;
    background: rgba(14, 25, 45, 0.24);
    box-sizing: border-box;
    overflow: visible;
    cursor: default;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        filter 160ms ease,
        box-shadow 160ms ease;
}

.character-ability-card.is-locked,
.character-ability-card.is-locked * {
    cursor: default;
}

.character-ability-art {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.character-ability-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.character-ability-name {
    flex: 0 0 auto;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.15;
    max-width: 82px;
}

.character-ability-description {
    flex: 0 0 auto;
    font-size: 8px;
    line-height: 1.15;
    color: rgba(247, 248, 252, 0.74);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 76px;
}

.character-ability-card-upgrade-stack {
    left: 50%;
    right: auto;
    top: auto;
    bottom: -10px;
    transform: translateX(-50%);
    z-index: 3;
}

.character-ability-card-upgrade-stack .dashboard-upgrade-button {
    width: 30px;
    height: 18px;
}

.character-ability-card-upgrade-stack .dashboard-upgrade-arrow {
    border-radius: 3px;
}

.character-ability-card-upgrade-stack .dashboard-upgrade-arrow-icon {
    width: 8px;
    height: 8px;
    border-top-width: 2px;
    border-left-width: 2px;
    transform: translateY(1px) rotate(45deg);
}

.character-ability-card-upgrade-stack .dashboard-upgrade-button:not(:disabled) {
    cursor: pointer;
}

.character-ability-card-upgrade-stack .dashboard-upgrade-button:disabled {
    cursor: default;
    opacity: 0.45;
}

.character-ability-card-upgrade-stack .dashboard-upgrade-button:disabled .dashboard-upgrade-arrow {
    box-shadow: none;
    filter: grayscale(0.6);
}

.character-ability-level-rail {
    position: absolute;
    top: 19px;
    left: calc(50% + 33px);
    width: 6px;
    height: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.character-ability-level-rail::before {
    content: "";
    position: absolute;
    top: 2px;
    bottom: 2px;
    left: 50%;
    width: 1px;
    transform: translateX(-50%);
    background: rgba(244, 247, 255, 0.38);
}

.character-ability-level-diamond {
    width: 6px;
    height: 6px;
    display: block;
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    border: 1px solid rgba(244, 247, 255, 0.68);
    background: rgba(10, 18, 33, 0.92);
    transform: rotate(45deg);
}

.character-ability-level-diamond.is-filled {
    background: #f4f7ff;
    box-shadow: none;
}

.character-ability-detail-overlay {
    position: absolute;
    top: calc(var(--character-card-top) + 8px);
    left: calc(var(--character-card-left) + 8px);
    width: calc(var(--character-card-width) - 16px);
    height: calc(var(--character-card-height) - 16px);
    z-index: 6;
    box-sizing: border-box;
    padding: 26px 20px 20px;
    background:
        linear-gradient(180deg, rgba(15, 27, 50, 0.98), rgba(8, 17, 33, 0.99));
    color: #f7f8fc;
    font-family: var(--dashboard-font-family);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.character-ability-detail-overlay.hidden {
    display: none;
}

.character-ability-detail-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: auto;
    height: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
    color: #f1f6ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: "Arial Black", "Arial", sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    text-transform: none;
    transform: scaleY(0.9);
    transform-origin: center;
    cursor: pointer;
}

.character-ability-detail-close:focus-visible {
    color: #ffffff;
    outline: none;
}

@media (hover: hover) and (pointer: fine) {
    .character-ability-detail-close:hover {
        color: #ffffff;
        outline: none;
    }
}

.character-ability-detail-icon {
    width: 76px;
    height: 76px;
    object-fit: cover;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    margin: 2px 0 10px;
}

.character-ability-detail-title {
    margin: 0;
    max-width: 240px;
    color: #ffffff;
    font-size: 22px;
    line-height: 1.1;
    font-weight: 700;
    text-align: center;
}

.character-ability-detail-description {
    margin: 10px 0 16px;
    max-width: 244px;
    min-height: 52px;
    color: rgba(247, 248, 252, 0.78);
    font-size: 12px;
    line-height: 1.34;
    text-align: center;
}

.character-ability-detail-levels {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.character-ability-detail-level-box {
    width: 100%;
    min-height: 54px;
    box-sizing: border-box;
    padding: 7px 8px 7px 12px;
    border: 1px solid rgba(139, 208, 255, 0.28);
    border-radius: 3px;
    background: rgba(14, 25, 45, 0.36);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.character-ability-detail-level-box.is-owned {
    border-color: rgba(244, 247, 255, 0.44);
    background: rgba(30, 45, 70, 0.42);
}

.character-ability-detail-level-box.is-next {
    border-color: rgba(139, 208, 255, 0.52);
}

.character-ability-detail-level-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.character-ability-detail-level-title {
    color: #f7f8fc;
    font-size: 13px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.character-ability-detail-level-status {
    color: rgba(247, 248, 252, 0.64);
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.character-ability-detail-upgrade-stack {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    margin: 0;
    flex: 0 0 auto;
}

.character-ability-detail-upgrade-button:disabled {
    cursor: default;
    opacity: 0.45;
}

.character-ability-detail-upgrade-button:disabled .dashboard-upgrade-arrow {
    box-shadow: none;
    filter: grayscale(0.6);
}

@media (max-width: 1200px) {
    .character-identity-lockup h2 {
        font-size: 20px;
    }

    .character-level {
        font-size: 15px;
    }

    .character-rank-title {
        font-size: 18px;
    }

    .character-resource-label {
        font-size: 16px;
    }

    .character-resource-value {
        font-size: 26px;
    }
}
