/* ===============================
   INFO / INTRO
=============================== */
.info-box {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
}

.intro-text {
    line-height: 1.7;
    color: #EDEAFF;
    font-size: 14px;
}

.story-em {
    color: var(--accent);
    font-weight: 600;
}


/* ===============================
   TAB BAR / BUTTONS
=============================== */
.tab-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.tab-btn {
    flex: 1;
    padding: 8px 0;
    background: #1B1928;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 500;
    cursor: pointer;
}

    .tab-btn.active {
        background: var(--accent);
        color: #fff;
    }


/* ===============================
   CONTENT
=============================== */
.content-box {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 14px;
    flex: 1;
    overflow: visible; /* 🔥 반드시 visible */
    position: relative; /* 🔥 추가 */
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}


/* ===============================
   SKILL
=============================== */
.skill-box {
    background: #141221; /* 더 진한 내부 */
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1.5px solid rgba(143,75,255,0.75);
    box-shadow: 0 4px 14px rgba(120,60,255,0.25);
}

.skill-name {
    font-size: 15px;
    font-weight: 700;
    color: #caa7ff;
    margin-bottom: 6px;
}

.skill-desc {
    font-size: 14px;
    line-height: 1.7;
    color: #EDEAFF;
}

    .skill-box strong {
        display: block;
        margin-bottom: 4px;
        color: var(--accent);
    }


/* ===============================
   CHARACTER IMAGE
=============================== */
.char-image-box {
    width: 70vw;
    max-width: 230px;
    aspect-ratio: 1 / 1;
    margin: 0 auto 16px;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    border: 2px solid rgba(143,75,255,0.6);
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
    pointer-events: auto;
    cursor: pointer;
    isolation: isolate; /* 🔥 핵심 */
    z-index: 1;
    pointer-events: auto;
}

    .char-image-box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .char-image-box::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient( to bottom, rgba(0,0,0,0) 55%, rgba(0,0,0,0.65) 100% );
        pointer-events: none;
    }


    .image-edit-icon,
    .char-name-overlay,
    .char-image-box::after {
        pointer-events: none;
    }

.char-name-overlay {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    padding: 4px 10px;
    border-radius: 999px;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    z-index: 2; /* 🔥 핵심 */
    pointer-events: none;
}


/* ===============================
   IMAGE EDIT BUTTON
=============================== */
.image-edit-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1; /* 🔥 항상 표시 */

    z-index: 3; /* 이미지 위에만 */
    pointer-events: none;
}
.char-image-box img {
    position: relative;
    z-index: 0;
    pointer-events: none;
}
.image-edit-icon {
    transform: translateZ(0); /* 🔥 모바일 hit-test 안정화 */
}

.char-image-box:not(.own-character) .image-edit-icon {
    display: none;
}


.image-edit-icon svg {
    width: 16px;
    height: 16px;
}


/* ===============================
   INFO GRID (2x2)
=============================== */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.info-cell {
    background: #1B1928;
    border-radius: 12px;
    padding: 10px 8px;
    text-align: center;
}

    .info-cell .label {
        font-size: 12px;
        color: #9A96B8;
        margin-bottom: 2px;
    }

    .info-cell .value {
        font-size: 14px;
        font-weight: 600;
        color: #EDEAFF;
    }

    .info-cell.placeholder {
        background: transparent;
        border: 1px dashed rgba(255,255,255,0.15);
    }



/* ===============================
   DIALOG (FULL STORY)
   app 기준으로 고정
=============================== */





.story-box {
    width: 100%;
    padding: 0; /* padding은 dlg-body가 담당 */
    font-size: 20px; /* 15px 기준 약 +30% */
    line-height: 1.9;
    color: #ffffff;
}




.story-title {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    margin: 8px auto 24px;
    color: #e6dbff;
}








/* ===============================
   BLUR / OVERLAY
=============================== */
/* blur는 page-body만 */
.app.is-blurred .page-body {
    filter: blur(6px);

}








/* battle-item은 transform 금지 */
.battle-item.clickable-preview:hover {
    transform: none;
    box-shadow: 0 8px 22px rgba(140,90,255,0.4);
}

.battle-item.clickable-preview:active {
    transform: none;
}


    .battle-item:hover {
        box-shadow: 0 10px 26px rgba(120,60,255,0.35);
    }

.battle-item {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 0;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(0,0,0,0.55);
    border: 2px solid rgba(143,75,255,0.55);
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.story-preview {
    position: relative;
    padding: 14px;
    border-radius: 14px;
    background: rgba(0,0,0,0.55);
    cursor: pointer;
    overflow: hidden; /* 🔥 페이드 잘리게 */
}

    /* 🔥 오른쪽 글자 페이드 */
    .story-preview::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 4.5em; /* ✅ 대략 5글자 폭 */
        height: 100%;
        pointer-events: none;
        background: linear-gradient( to right, rgba(0,0,0,0), rgba(0,0,0,0.85) );
    }





/* 전투 텍스트 공통 */
.battle-title-main,
.battle-sub,
.battle-story {
    color: #ffffff;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
/* 전투 상단 이미지 */
.battle-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 2px solid rgba(143,75,255,0.8);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 16px;
}

    .battle-hero img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.battle-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient( to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,0.75) 100% );
}


/* ===============================
   BATTLE LIST
=============================== */

.battle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.battle-body {
    padding: 12px 14px 14px;
    flex-shrink: 0; /* 🔥 추가 */
}
.battle-thumb {
    flex-shrink: 0;
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 7;
    overflow: hidden;
}

    .battle-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center 30%;
    }

.battle-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient( to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.75) 100% );
}





/* 제목 줄 */
.battle-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.battle-title-main {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

/* 승패 */
.battle-title-result {
    font-size: 13px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

    .battle-title-result.win {
        background: rgba(120,60,255,0.85);
    }

    .battle-title-result.lose {
        background: rgba(80,80,80,0.8);
    }

    .battle-title-result.neutral {
        background: rgba(120,120,120,0.6);
    }

/* 미리보기 */
.battle-mode-line {
    margin-bottom: 4px;
}

.battle-meta-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 20px;
    margin: 0 0 4px;
}

.battle-meta-row .battle-elo {
    margin-top: 0;
    text-align: right;
}

.battle-mode-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #f3e2fe;
    background: rgba(82, 51, 105, 0.34);
    border: 1px solid rgba(82, 51, 105, 0.75);
}

.battle-mode-chip.is-normal {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.battle-mode-chip.is-competitive {
    background: rgba(152, 0, 255, 0.16);
    border-color: rgba(152, 0, 255, 0.5);
}

.battle-sub {
    font-size: 14px;
    line-height: 1.6;
    color: #ffffff;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}
/* ===============================
   PAGER
=============================== */

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px 0 4px;
}

.pager-btn {
    background: #000;
    color: #8f4bff;
    border: 1.5px solid rgba(143,75,255,0.6);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    cursor: pointer;
}

    .pager-btn.hidden {
        display: none;
    }

.pager-pages {
    display: flex;
    gap: 6px;
}

.pager-page {
    min-width: 32px;
    text-align: center;
    padding: 6px 0;
    background: #000;
    color: #8f4bff;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

    .pager-page.active {
        background: #8f4bff;
        color: #000;
        font-weight: 700;
    }


#charImageBox.disabled {
    pointer-events: none;
    opacity: 0.7;
}
.battle-date {
    font-size: 12px;
    opacity: 0.6;
    margin-top: 4px;
}
/* ===============================
   REGION WRAP POPUP ONLY
=============================== */

.region-wrap-desc {
    margin-bottom: 16px;
}

.region-wrap-download-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #523369;
    background: linear-gradient(145deg, #1a1024, #140c1d);
    color: #e2ccff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.5);
}

    .region-wrap-download-btn:hover {
        transform: translateY(-2px);
        border-color: #6f40a6;
        box-shadow: 0 6px 14px rgba(82,51,105,0.6);
    }

    .region-wrap-download-btn:active {
        transform: translateY(0);
        box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
    }
/* ===============================
   REGION CHIP (origin / region only)
=============================== */

.region-value {
    display: flex;
    justify-content: center;
}

.region-stack {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: max-content;
    max-width: 100%;
}

.region-branch-row {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    padding-left: 4px;
    width: 100%;
}

.region-branch-mark {
    display: inline-block;
    flex: 0 0 auto;
    width: 12px;
    height: 10px;
    margin-top: 4px;
    box-sizing: border-box;
    border-left: 1.8px solid rgba(217, 198, 255, 0.72);
    border-bottom: 1.8px solid rgba(217, 198, 255, 0.72);
    border-bottom-left-radius: 2px;
}

.region-branch-mark::before,
.region-branch-mark::after {
    content: none !important;
    display: none !important;
}

.region-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 4px 10px;
    border: 1px solid #523369;
    border-radius: 6px;
    background: linear-gradient(145deg, #1a1024, #140c1d);
    color: #d9c6ff;
    font-size: 13px;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.region-chip-origin {
    text-decoration: underline;
}

.region-chip-region {
    text-decoration: underline;
}

.region-chip:hover {
    background: linear-gradient(145deg, #23133a, #1b0f2a);
    border-color: #6e3fa3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(82,51,105,0.6);
}

.region-chip:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.6) inset;
}

.arcana-entry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: auto;
    min-width: 96px;
    max-width: 100%;
    padding: 8px 16px;
    border: 1px solid #523369;
    border-radius: 10px;
    background: linear-gradient(145deg, #1a1024, #140c1d);
    color: #d9c6ff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.arcana-entry-btn:hover {
    background: linear-gradient(145deg, #23133a, #1b0f2a);
    border-color: #6e3fa3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(82,51,105,0.6);
}

.arcana-entry-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.6) inset;
}
.clickable-preview {
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.battle-elo {
    font-weight: 600;
    font-size: 14px;
    margin-top: 4px;
}

/* 승자 */
.elo-plus {
    color: #ffffff;
    text-shadow: 0 0 6px #9800FF, 0 0 10px rgba(152,0,255,0.6);
}

/* 패자 */
.elo-minus {
    color: #ffffff;
    text-shadow: 0 0 6px #ff5f5f, 0 0 10px rgba(255,95,95,0.6);
}



.elo-zero {
    color: #888;
}
.battle-item.win {
    border: 2px solid #3ecf8e;
}

.battle-item.lose {
    border: 2px solid #ff5f5f;
}
/* ===============================
   SKELETON LOADING
=============================== */

.skeleton-line {
    height: 14px;
    background: var(--skeleton-block-bg);
    background-size: 200% 100%;
    border-radius: 6px;
    animation: skeletonMove 1.2s infinite linear;
}

    .skeleton-line.short {
        width: 60%;
        margin: 0 auto;
    }

.skeleton-block {
    height: 16px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: var(--skeleton-block-bg);
    background-size: 200% 100%;
    animation: skeletonMove 1.2s infinite linear;
}

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

    100% {
        background-position: -200% 0;
    }
}
/* ===============================
   BATTLE SKELETON / EMPTY
=============================== */

.battle-empty-card,
.battle-skeleton-item {
    display: flex;
    flex-direction: column;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0,0,0,0.45);
}

.battle-empty-card {
    background: rgba(0,0,0,0.55);
    border: 2px solid rgba(143,75,255,0.55);
}

.battle-skeleton-item {
    background: var(--skeleton-card-bg);
    border: 1px solid var(--skeleton-border-strong);
}

.battle-empty-card {
    min-height: 190px;
    justify-content: center;
    align-items: center;
    padding: 20px 16px;
    text-align: center;
}

.battle-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: #F3E2FE;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    line-height: 1.7;
}

.battle-empty-sub {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(243,226,254,0.72);
}

.battle-skeleton-thumb {
    width: 100%;
    aspect-ratio: 16 / 7;
    background: var(--skeleton-block-bg);
    background-size: 200% 100%;
    animation: skeletonMove 1.2s infinite linear;
}

.battle-skeleton-body {
    padding: 12px 14px 14px;
}

.battle-skeleton-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.battle-skeleton-title,
.battle-skeleton-badge,
.battle-skeleton-elo,
.battle-skeleton-date,
.battle-skeleton-line {
    border-radius: 6px;
    background: var(--skeleton-block-bg);
    background-size: 200% 100%;
    animation: skeletonMove 1.2s infinite linear;
}

.battle-skeleton-title {
    width: 42%;
    height: 16px;
}

.battle-skeleton-badge {
    width: 44px;
    height: 22px;
    border-radius: 999px;
}

.battle-skeleton-elo {
    width: 54px;
    height: 14px;
    margin-bottom: 8px;
}

.battle-skeleton-date {
    width: 110px;
    height: 12px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.battle-skeleton-line {
    height: 13px;
    margin-bottom: 8px;
}

    .battle-skeleton-line.w-92 {
        width: 92%;
    }

    .battle-skeleton-line.w-78 {
        width: 78%;
    }

    .battle-skeleton-line.w-55 {
        width: 55%;
    }


/* ===============================
   ARCANA EQUIPPED INDICATORS
=============================== */
.arcana-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 84px;
}

.arcana-cell.is-mine .arcana-entry-btn {
    width: auto;
    min-width: 96px;
}

.arcana-readonly-label {
    color: #9A96B8;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.arcana-equipped-indicators {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 20px;
}

.arcana-slot-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(221, 208, 255, 0.24);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.28));
    transition: transform 0.15s ease, color 0.15s ease, filter 0.15s ease;
}

.arcana-slot-icon svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.arcana-slot-icon path {
    fill: currentColor;
    stroke: rgba(237, 234, 255, 0.7);
    stroke-width: 1.6;
    stroke-linejoin: round;
}

.arcana-slot-icon.is-active {
    color: #f4deff;
    filter:
        drop-shadow(0 0 6px rgba(173, 114, 255, 0.58))
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.22));
    transform: translateY(-1px);
}

.arcana-slot-icon.is-active path {
    stroke: rgba(255, 255, 255, 0.92);
}

.arcana-cell.is-readonly {
    padding-top: 12px;
    padding-bottom: 12px;
}

/* ===============================
   SKILL ORDER EDITOR
=============================== */
.skill-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-box.is-selected {
    border-color: rgba(202,167,255,0.95);
    box-shadow: 0 6px 18px rgba(143,75,255,0.3);
}

.skill-box-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.skill-order-panel {
    background: #141221;
    border: 1.5px solid rgba(143,75,255,0.75);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: 0 4px 14px rgba(120,60,255,0.18);
}

.skill-order-panel.is-readonly {
    opacity: 0.96;
}

.skill-order-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.skill-order-panel-title {
    font-size: 15px;
    font-weight: 700;
    color: #e7d6ff;
}

.skill-order-panel-desc,
.skill-order-tip {
    font-size: 12px;
    line-height: 1.5;
    color: #b9b1d8;
}

.skill-order-tip.is-ready {
    color: #d7c3ff;
}

.skill-order-panel-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.skill-order-mini-btn,
.skill-order-save-btn,
.skill-order-action-btn,
.skill-order-slot-btn {
    border: 1px solid rgba(143,75,255,0.55);
    border-radius: 999px;
    background: rgba(143,75,255,0.12);
    color: #f3e6ff;
    padding: 7px 12px;
    font-size: 12px;
    cursor: pointer;
}

.skill-order-save-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.skill-order-action-btn.is-remove,
.skill-order-slot-btn.is-remove {
    border-color: rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.07);
}

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

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

.skill-order-slot-num,
.skill-order-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(143,75,255,0.2);
    color: #f5e9ff;
    font-size: 12px;
    font-weight: 700;
}

.skill-order-badge-wrap {
    min-height: 24px;
}

.skill-order-slot-name {
    color: #f3e6ff;
    font-size: 13px;
    font-weight: 600;
}

.skill-order-empty {
    color: #b9b1d8;
    font-size: 13px;
}

.skill-order-action-row {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.skill-order-popover {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 4;
    min-width: 180px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(143,75,255,0.5);
    background: #120f1d;
    box-shadow: 0 10px 24px rgba(0,0,0,0.45);
}

.skill-order-popover-title {
    font-size: 13px;
    font-weight: 700;
    color: #f2e7ff;
    margin-bottom: 8px;
}

.skill-order-popover-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 540px) {
    .skill-order-panel-header {
        flex-direction: column;
    }

    .skill-order-panel-actions {
        width: 100%;
    }

    .skill-order-mini-btn,
    .skill-order-save-btn {
        flex: 1;
        text-align: center;
    }
}


/* ===============================
   SKILL ORDER MINIMAL EDITOR
=============================== */
.skill-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.skill-mode-btn {
    border: 1px solid rgba(143,75,255,0.55);
    border-radius: 999px;
    background: rgba(143,75,255,0.12);
    color: #f3e6ff;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.skill-mode-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.skill-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skill-box-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.skill-box.is-selected {
    border-color: rgba(202,167,255,0.95);
    box-shadow: 0 6px 18px rgba(143,75,255,0.3);
}

.skill-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;
}

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

.skill-box.is-editing {
    cursor: pointer;
    transform-origin: center;
}

.skill-box.is-editing:active {
    transform: scale(0.99);
}

.skill-box.is-editing:nth-child(4n + 1) {
    animation: skillBoxShakeA 1.48s ease-in-out infinite;
    animation-delay: -0.18s;
}

.skill-box.is-editing:nth-child(4n + 2) {
    animation: skillBoxShakeB 1.82s ease-in-out infinite;
    animation-delay: -0.63s;
}

.skill-box.is-editing:nth-child(4n + 3) {
    animation: skillBoxShakeC 1.57s ease-in-out infinite;
    animation-delay: -0.34s;
}

.skill-box.is-editing:nth-child(4n) {
    animation: skillBoxShakeD 1.94s ease-in-out infinite;
    animation-delay: -0.81s;
}

@keyframes skillBoxShakeA {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    18% { transform: rotate(-0.7deg) translateY(0); }
    39% { transform: rotate(0.85deg) translateY(-1px); }
    63% { transform: rotate(-0.45deg) translateY(0); }
    82% { transform: rotate(0.4deg) translateY(1px); }
}

@keyframes skillBoxShakeB {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    22% { transform: rotate(0.55deg) translateY(-1px); }
    41% { transform: rotate(-0.9deg) translateY(0); }
    68% { transform: rotate(0.5deg) translateY(1px); }
    84% { transform: rotate(-0.35deg) translateY(0); }
}

@keyframes skillBoxShakeC {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    16% { transform: rotate(-0.45deg) translateY(1px); }
    37% { transform: rotate(0.7deg) translateY(0); }
    58% { transform: rotate(-0.8deg) translateY(-1px); }
    81% { transform: rotate(0.3deg) translateY(0); }
}

@keyframes skillBoxShakeD {
    0%, 100% { transform: rotate(0deg) translateY(0); }
    21% { transform: rotate(0.8deg) translateY(0); }
    46% { transform: rotate(-0.55deg) translateY(1px); }
    66% { transform: rotate(0.55deg) translateY(-1px); }
    87% { transform: rotate(-0.25deg) translateY(0); }
}
