/* /public/stylesheet/battle/battle.css */

/* battle prep layout */
#battlePrepRoot {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 0 12px;
}

    #battlePrepRoot .battle-prep-stack {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    #battlePrepRoot .battle-panel {
        background: rgba(0, 0, 0, 0.35);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 14px;
        padding: 12px;
        backdrop-filter: blur(6px);
    }

    #battlePrepRoot .panel-title-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 10px;
    }

    #battlePrepRoot .panel-title {
        font-weight: 800;
        letter-spacing: -0.2px;
        font-size: 14px;
        opacity: 0.92;
    }

    #battlePrepRoot .panel-subtitle {
        margin-top: 10px;
        margin-bottom: 6px;
        font-size: 12px;
        opacity: 0.75;
    }

    #battlePrepRoot .battle-char-card,
    #battlePrepRoot .battle-char-card-link {
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }

    #battlePrepRoot .battle-char-card-link {
        width: 100%;
        border: 0;
        padding: 0;
        background: transparent;
        color: inherit;
        text-align: left;
        cursor: pointer;
        border-radius: 14px;
        transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    }

        #battlePrepRoot .battle-char-card-link:hover {
            transform: translateY(-1px);
        }

        #battlePrepRoot .battle-char-card-link:active {
            transform: translateY(0);
        }

        #battlePrepRoot .battle-char-card-link:focus-visible {
            outline: 1px solid rgba(255, 255, 255, 0.25);
            outline-offset: 2px;
        }

        #battlePrepRoot .battle-char-card img,
        #battlePrepRoot .battle-char-card-link img {
            width: 56px;
            height: 56px;
            border-radius: 14px;
            object-fit: cover;
            border: 1px solid rgba(255, 255, 255, 0.12);
            background: rgba(0, 0, 0, 0.2);
            flex: 0 0 auto;
        }

    #battlePrepRoot .battle-char-meta {
        flex: 1 1 auto;
        min-width: 0;
    }

    #battlePrepRoot .battle-char-name {
        font-weight: 800;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #battlePrepRoot .battle-char-sub {
        margin-top: 2px;
        font-size: 12px;
        opacity: 0.7;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #battlePrepRoot .battle-prompt-preview {
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 12px;
        padding: 10px;
        min-height: 0;
        font-size: 13px;
        line-height: 1.45;
        overflow: visible;
        word-break: keep-all;
    }

    #battlePrepRoot .battle-intro-clamp {
        display: block;
        overflow: visible;
    }

        #battlePrepRoot .battle-intro-clamp > * {
            margin: 0;
        }

        #battlePrepRoot .battle-intro-clamp br {
            display: none;
        }

    #battlePrepRoot .battle-skill-row {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    #battlePrepRoot .battle-skill-chip {
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.08);
        padding: 6px 8px;
        border-radius: 999px;
        font-size: 12px;
        cursor: pointer;
        user-select: none;
    }

        #battlePrepRoot .battle-skill-chip:active {
            transform: translateY(1px);
        }

    #battlePrepRoot .badge {
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(0, 0, 0, 0.25);
        font-size: 11px;
        padding: 4px 8px;
        border-radius: 999px;
        opacity: 0.85;
        white-space: nowrap;
    }

    #battlePrepRoot .mini-btn {
        border: 1px solid rgba(255, 255, 255, 0.16);
        background: rgba(255, 255, 255, 0.08);
        color: inherit;
        border-radius: 999px;
        padding: 6px 10px;
        font-size: 12px;
        cursor: pointer;
        white-space: nowrap;
    }

        #battlePrepRoot .mini-btn:disabled {
            opacity: 0.5;
            cursor: default;
        }

    #battlePrepRoot #battleCharList {
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-top: 10px;
    }

@media (min-width: 720px) {
    #battlePrepRoot #battleCharList {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

#battlePrepRoot .battle-char-item-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    text-align: left;
    color: inherit;
}

    #battlePrepRoot .battle-char-item-card.selected {
        border-color: rgba(255, 255, 255, 0.35);
        background: rgba(255, 255, 255, 0.06);
    }

    #battlePrepRoot .battle-char-item-card img {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        object-fit: cover;
        border: 1px solid rgba(255, 255, 255, 0.1);
        flex: 0 0 auto;
    }

#battlePrepRoot .battle-char-item-name {
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#battlePrepRoot .battle-char-item-sub {
    margin-top: 2px;
    font-size: 11px;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#battlePrepRoot .battle-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* skeleton */
#battlePrepRoot .battle-char-card-skeleton {
    pointer-events: none;
}

#battlePrepRoot .battle-skeleton-avatar {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    flex: 0 0 auto;
    background: var(--skeleton-block-bg);
    background-size: 200% 100%;
    animation: battleSkeletonMove 1.2s infinite linear;
}

#battlePrepRoot .battle-skeleton-line {
    height: 12px;
    border-radius: 999px;
    background: var(--skeleton-block-bg);
    background-size: 200% 100%;
    animation: battleSkeletonMove 1.2s infinite linear;
}

#battlePrepRoot .battle-skeleton-name {
    width: 56%;
}

#battlePrepRoot .battle-skeleton-sub {
    width: 78%;
    margin-top: 8px;
}

#battlePrepRoot .battle-skeleton-text-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#battlePrepRoot .battle-skill-chip-skeleton {
    min-width: 64px;
    min-height: 28px;
    cursor: default;
    background: var(--skeleton-block-bg);
    background-size: 200% 100%;
    border-color: var(--skeleton-border);
    animation: battleSkeletonMove 1.2s infinite linear;
}

@keyframes battleSkeletonMove {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* battle skill order editor */
#battlePrepRoot .battle-order-editor-slot {
    width: 100%;
    margin-top: 8px;
}

#battlePrepRoot .battle-order-editor {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 10px;
}

#battlePrepRoot .battle-order-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

#battlePrepRoot .battle-order-editor-title {
    font-size: 13px;
    font-weight: 800;
}

#battlePrepRoot .battle-order-editor-desc,
#battlePrepRoot .battle-order-empty {
    font-size: 12px;
    opacity: 0.72;
}

#battlePrepRoot .battle-order-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

#battlePrepRoot .battle-order-slot {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

#battlePrepRoot .battle-order-slot-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    font-size: 11px;
    font-weight: 800;
}

#battlePrepRoot .battle-order-slot-name {
    font-size: 12px;
    font-weight: 700;
}

#battlePrepRoot .battle-order-pick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

#battlePrepRoot .battle-order-pick-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: inherit;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

#battlePrepRoot .battle-order-pick-chip strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.14);
    font-size: 11px;
}

#battlePrepRoot .battle-order-pick-chip.is-selected {
    border-color: rgba(255,255,255,0.28);
    background: rgba(255,255,255,0.11);
}

#battlePrepRoot .battle-order-reset-btn {
    flex-shrink: 0;
}

#battlePrepRoot .battle-order-popover {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 3;
    display: flex;
    gap: 6px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0, 0, 0, 0.86);
    box-shadow: 0 10px 22px rgba(0,0,0,0.35);
}

#battlePrepRoot .battle-order-pop-btn {
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.06);
    color: inherit;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 11px;
    cursor: pointer;
}

#battlePrepRoot .battle-order-pop-btn.is-remove {
    background: rgba(255,255,255,0.1);
}

#battlePrepRoot .battle-order-pop-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

@media (max-width: 540px) {
    #battlePrepRoot .battle-order-editor-head {
        flex-direction: column;
    }

    #battlePrepRoot .battle-order-reset-btn {
        width: 100%;
    }
}


/* battle minimal skill selector */
#battlePrepRoot .battle-skill-row--my {
    display: block;
}

#battlePrepRoot .battle-order-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

#battlePrepRoot .battle-order-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    padding: 12px;
    cursor: pointer;
}

#battlePrepRoot .battle-order-card:active {
    transform: translateY(1px);
}

#battlePrepRoot .battle-order-card.is-selected {
    border-color: rgba(202,167,255,0.95);
    box-shadow: 0 6px 18px rgba(143,75,255,0.24);
}

#battlePrepRoot .battle-order-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

#battlePrepRoot .battle-order-card-name {
    font-size: 14px;
    font-weight: 700;
    color: #f3e6ff;
}

#battlePrepRoot .battle-order-card-desc {
    font-size: 13px;
    line-height: 1.65;
    color: #edeaff;
}

#battlePrepRoot .battle-order-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1.5px solid rgba(202,167,255,0.55);
    background: rgba(255,255,255,0.03);
    color: #f5e9ff;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 auto;
}

#battlePrepRoot .battle-order-circle.is-selected {
    background: rgba(143,75,255,0.22);
    border-color: rgba(202,167,255,0.95);
}

#battlePrepRoot .battle-char-overlay-slot {
    position: relative;
}

#battlePrepRoot #battleCharList {
    display: none;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 640px);
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 14px;
    z-index: 1200;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(10, 8, 18, 0.94);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 44px rgba(0,0,0,0.45);
}

#battlePrepRoot #battleCharList.is-open {
    display: grid;
}

#battlePrepRoot #battleCharList.is-open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(0,0,0,0.44);
}


#battlePrepRoot #battleLimitInfo {
    width: 100%;
}

#battlePrepRoot .battle-limit-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

#battlePrepRoot .battle-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding-right: 12px;
}

#battlePrepRoot .battle-start-btn-label {
    display: inline-flex;
    align-items: center;
}

#battlePrepRoot .battle-start-cost {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    padding-left: 8px;
    border-left: 1px solid rgba(255,255,255,0.14);
    font-size: 12px;
    font-weight: 700;
}

#battlePrepRoot .battle-start-cost-icon {
    width: 14px;
    height: 14px;
    min-width: 14px;
    min-height: 14px;
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
    flex: 0 0 auto;
}

#battlePrepRoot .battle-start-cost-icon use {
    fill: currentColor;
}


#battlePrepRoot .battle-my-skill-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

#battlePrepRoot .battle-my-skill-title {
    font-size: 14px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.94);
}

#battlePrepRoot .battle-my-skill-tip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid rgba(202, 167, 255, 0.52);
    background: rgba(255, 255, 255, 0.05);
    color: #f3e6ff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    flex: 0 0 auto;
}

#battlePrepRoot .battle-my-skill-tip-btn:active {
    transform: translateY(1px);
}
