/* 커스텀 체크박스 스타일 */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    background-image: url('/assets/img/ui/check-off.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    vertical-align: middle;
    margin: 0;
}

input[type="checkbox"]:checked {
    background-image: url('/assets/img/ui/check-on.png');
}

input[type="checkbox"]:focus {
    outline: none;
}

/* 체크박스 포커스 스타일 제거 */
input[type="checkbox"]:hover {
    opacity: 0.8;
}


#spoilerToggleWrap {
    display: flex;
    gap: 4px;
}

/* 상단 카드 컨테이너 */
.top-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
    padding: 0px 0px 0px 0px;
}

@media (max-width: 1200px) {
    .top-cards {
        margin-bottom: 32px;
    }
}

/* Page title row layout with spoiler toggle */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0px 10px 0px;
}

#spoilerToggleWrap {
    margin-left: auto;
}

@media (max-width: 1200px) {
    .header-container {
        flex-wrap: wrap;
        gap: 8px;
    }

    #spoilerToggleWrap {
        width: 100%;
        order: 2;
        display: flex;
        margin-bottom: 20px;
    }
}

.boss-card {
    padding: 20px;
    text-align: left;
    background-color: var(--card-background);
    border-radius: 10px;
    border-bottom: 3px solid var(--border-red);
}

.damage-card,
.defense-coef-card {
    padding: 10px 20px 10px 20px;
    text-align: left;
    background-color: var(--card-background);
    border-radius: 10px;
    border-bottom: 3px solid var(--border-red);
}

.stat-card {
    padding: 10px 20px 10px 20px;
    text-align: left;
    background-color: var(--card-background);
    border-radius: 10px;
    border-bottom: 3px solid var(--border-red);
}

.top-cards h2 {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    padding: 10px 0px 10px 0px;
    margin: 0px;
}


.total-defense {
    margin-bottom: 20px;
    text-align: left;
    padding: 0 20px;
}

.total-value,
.penetrate-value {
    font-size: 36px;
    font-weight: bold;
    color: #dd8484;
}

.total-value-description,
.penetrate-value-description,
.defense-reduce-value-description {
    margin-top: 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}


.boss-type-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.boss-type-tabs .tooltip-icon {
    margin-left: auto;
}

#bossInfoTooltip {
    color: rgba(255, 205, 125, 0.9);
}

#bossInfoTooltip svg circle {
    stroke-opacity: 0.3;
    fill: rgba(255, 189, 89, 0.12);
}

#bossInfoTooltip:hover {
    color: rgba(255, 225, 175, 1);
}

.boss-info-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -2px 0 10px 0;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 189, 89, 0.25);
    background-color: rgba(255, 189, 89, 0.08);
}

.boss-info-inline-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 205, 125, 0.35);
    background-color: rgba(255, 205, 125, 0.15);
    color: rgba(255, 218, 157, 0.95);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}

.boss-info-inline-text {
    color: rgba(255, 240, 214, 0.92);
    font-size: 12px;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .boss-info-inline {
        gap: 6px;
        padding: 6px 8px;
    }

    .boss-info-inline-badge {
        font-size: 9px;
    }

    .boss-info-inline-text {
        font-size: 11px;
    }
}

.boss-type-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.boss-type-tab:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.boss-type-tab.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
}

.boss-type-icon {
    width: auto;
    height: 18px;
    object-fit: contain;
}

.boss-list-container {
    /* Reduce list height by the inline reference notice height to keep card heights aligned */
    max-height: 189.56px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.03);
    cursor: grab;
}

.boss-list-container:active {
    cursor: grabbing;
}

.boss-list-container::-webkit-scrollbar {
    width: 6px;
}

.boss-list-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.boss-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.boss-list-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.boss-list {
    display: flex;
    flex-direction: column;
}

.boss-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.boss-list-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.boss-list-name {
    flex: 1;
}

.boss-list-item:last-child {
    border-bottom: none;
}

.boss-list-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.boss-list-item.selected {
    background-color: rgba(255, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

.boss-stats {
    display: flex;
    flex-direction: column;
    margin: 0px;
}

.damage-formula,
.boss-stats {
    margin-top: 10px;
    font-size: 12px !important;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

.damage-increase {
    font-size: 24px;
    font-weight: bold;
    color: #ff5151;
    line-height: 1;
}

/* Row layouts */
.top-row-1 {
    display: grid;
    grid-template-columns: 0.5fr 1fr;
    gap: 20px;
    align-items: start;
}

/* 통합 통계 카드 (우측 상단 카드) */
.unified-stats-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
    background-color: var(--card-background);
    border-radius: 10px;
    border-bottom: 3px solid var(--border-red);
}

.unified-stat-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.unified-stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.unified-stat-row h2 {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    padding: 0;
    margin: 0;
    min-width: 180px;
    flex-shrink: 0;
}

.unified-stat-row h2 img {
    flex-shrink: 0;
}

.unified-stat-row h2 .tooltip-icon {
    align-self: center;
    margin-left: 6px;
}

.unified-stat-row .stat-card-table {
    flex: 1;
    margin-top: 0;
}

.unified-stat-row .defense-coef-value {
    display: flex;
    align-items: center;
}

.unified-stat-row .damage-increase {
    display: flex;
    align-items: center;
}

/* Boss custom inputs */
.boss-custom-inputs {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.boss-custom-inputs .input-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.boss-custom-inputs label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.8);
    min-width: 180px;
    flex-shrink: 0;
}

.boss-custom-inputs .damage-multiplier-display {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

/* Order switch button - 숨김 처리 */
.order-switch {
    display: none !important;
}

.order-switch-cell {
    display: none !important;
}

/* Second step line (합계 / 목표) */
.second-step-line {
    margin-top: 6px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.second-step-line .second-sum {
    font-weight: 700;
    color: #dd8484;
}

.second-step-line .second-target {
    color: rgba(255, 255, 255, 0.8);
}

/* 합계/목표 라벨 */
.sum-target-label {
    margin-top: 6px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* 카드 내부 테이블 구조 */
.stat-card-table {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
}

.stat-card-cell {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

/* 아이콘 스타일 */
.stat-icon {
    width: 20px;
    height: 20px;
    margin-right: 6px;
    display: block;
    object-fit: contain;
    flex-shrink: 0;
}

/* 합계/목표/남은 수치 값 스타일 */
.penetrate-value,
.total-value {
    display: flex;
    align-items: baseline;
}

.value-sum {
    font-size: 24px;
    font-weight: bold;
    color: #dd8484;
    line-height: 1;
}

.penetrate-value .value-sum {
    color: #5384d8;
}

.value-target {
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
}

.penetrate-value .value-target {
    color: rgba(255, 255, 255, 0.6);
}

.value-remaining {
    font-size: 18px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1;
}

.penetrate-value .value-remaining {
    color: rgba(255, 255, 255, 0.6);
}

.total-value .value-remaining {
    color: rgba(255, 255, 255, 0.6);
}

/* 대미지 값 스타일 */
.damage-value {
    font-size: 18px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1;
}

/* 2행의 최종 대미지 카드 위치 */
.top-row-2-damage {}

/* 영역 매핑 제거 - 더 이상 grid-area 사용 안 함 */

/* 방어력 수치 (통합 카드 내부) */
.defense-stats-table {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 20px;
    flex: 1;
}

.defense-stat-cell {
    display: flex;
    flex-direction: column;
}

.defense-stat-cell .stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

.defense-coef-value {
    font-size: 24px;
    font-weight: bold;
    color: #eaeaea;
    line-height: 1;
}

.defense-stat-cell .defense-coef-value input {
    font-size: 18px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    width: 60%;
    text-align: left;
    box-sizing: border-box;
}

.defense-stat-cell .defense-coef-value .inline-input {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.defense-stat-cell .defense-coef-value .unit {
    color: rgba(255, 255, 255, 0.6);
    font-size: 20px;
    flex-shrink: 0;
}

/* 모바일 대응 */
@media (max-width: 1200px) {
    .top-cards {
        grid-template-columns: 1fr;
    }

    .top-row-1 {
        grid-template-columns: 1fr;
    }

    .boss-custom-inputs .input-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .boss-custom-inputs label {
        min-width: auto;
    }

    .unified-stats-card {
        gap: 24px;
        padding: 24px;
    }

    .unified-stat-row {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 24px;
        gap: 12px;
    }

    .unified-stat-row h2 {
        min-width: auto;
        padding-bottom: 0;
    }

    .stat-card-table {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        margin-top: 0;
        width: 100%;
    }

    .defense-stats-table {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        width: 100%;
    }

    .damage-value,
    .value-target,
    .value-remaining {
        font-size: 16px;
    }

    .defense-coef-value,
    .value-sum,
    .damage-increase {
        font-size: 20px;
    }

    .defense-stat-cell .defense-coef-value input {
        font-size: 16px;
    }

    .defense-stat-cell .defense-coef-value .unit {
        font-size: 14px;
    }

    .stat-icon {
        width: 18px;
        height: 18px;
    }

    .boss-list-container {
        max-height: calc(200px - 26px);
    }

    .boss-type-tab {
        padding: 6px 12px;
        font-size: 13px;
    }

    .boss-type-icon {
        width: auto;
        height: 16px;
    }

    .boss-list-item {
        padding: 8px 10px;
        font-size: 13px;
        gap: 6px;
    }

    .boss-list-icon {
        width: 20px;
        height: 20px;
    }
}






.defense-table,
.penetrate-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.defense-table th,
.penetrate-table th,
.defense-table td,
.penetrate-table td {
    font-size: 13px;
    padding: 6px;
    color: rgb(255, 255, 255, 0.4);
}

.defense-table tr.group-header .group-header-cell {
    padding: 0 !important;
    border-top: 2px solid #ffffff30
}

.defense-table tr.group-header .group-header-cell>.group-info {
    flex: 1 1 auto;
}

.defense-table tr.group-header .group-header-cell>.accordion-caret {
    flex: 0 0 auto;
}

.defense-table tr,
.penetrate-table tr {
    min-height: 30px;
}

.skill-name-column {
    color: rgb(247, 243, 243) !important;
}

.skill-name-column .skill-type-label {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.defense-table tr.selected .skill-name-column .skill-type-label,
.penetrate-table tr.selected .skill-name-column .skill-type-label {
    color: rgba(255, 255, 255, 0.4) !important;
}

.skill-name-column .type-only {
    color: rgb(247, 243, 243) !important;
}

.value-column {
    color: #dd8484 !important;
    font-weight: bold;
}

.check-column {
    width: 30px;
}


.char-img-column img {
    height: 36px;
    border-radius: 25px;
    object-fit: contain;
}

.skill-icon-column img {
    height: 24px;
    width: 24px;
    object-fit: contain;
}

.skill-icon {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain !important;
}

img[src*="item-mind_stat2.png"] {
    scale: 0.8;
}

img[src*="character-weapon"],
img[src*="wonder-weapon"] {
    scale: 1.1;
}


img[src*="check-off.png"] {
    width: 16px !important;
    height: 16px !important;
    object-fit: contain !important;
    opacity: 0.6;
    cursor: pointer;
    padding-left: 10px;
}

img[src*="check-on.png"] {
    width: 20px !important;
    height: 20px !important;
    object-fit: contain !important;
    transform: translateX(-1px) translateY(-0.5px);
    cursor: pointer;
    padding-left: 10px;
}

@media (max-width: 1200px) {

    img[src*="check-off.png"],
    img[src*="check-on.png"] {
        padding-left: 0px;
    }
}


.option-column select {
    font-size: 12px;
    background-color: rgb(0, 0, 0, 0.1);
    color: rgb(255, 255, 255, 0.4);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: fit-content;
    padding: 8px 4px !important;
}

/* 옵션 스타일링 */
select option {
    background-color: var(--card-background);
    color: rgb(255, 255, 255, 0.8);
}

/* 선택된 옵션 스타일링 */
select option:checked {
    background-color: #4d3e3e;
}

/* 호버 상태 스타일링 */
select option:hover {
    background-color: #4d3e3e;
}

/* Firefox에서 옵션 배경색 강제 적용 */
select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 rgb(255, 255, 255, 0.8);
}

.defense-table td,
.penetrate-table td {
    vertical-align: middle;
    padding: 8px;
}

/* 괴도 이름이 비어있는 행의 스타일 */
.defense-table tr:not(:first-child) td,
.penetrate-table tr:not(:first-child) td {
    border-top: 1px solid rgb(255, 255, 255, 0.08);
}

.defense-table tr.group-header td,
.penetrate-table tr.group-header td {
    background: rgba(255, 255, 255, 0.05);
}

.group-header-cell {
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.group-header-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
}

.group-header-inner .group-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.group-header-inner .accordion-caret {
    flex: 0 0 auto;
}

.group-header .group-name {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    margin-left: 8px;
    white-space: nowrap;
}

.group-header .group-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-header .group-avatar {
    height: 28px;
    border-radius: 25px;
    object-fit: contain;
}

.accordion-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 12px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    flex-shrink: 0;
}

.accordion-caret svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* 데스크탑에서는 기존 indent 유지 */
@media (min-width: 1201px) {
    .group-row[data-group] {
        margin-left: 8px;
    }

    .group-header+.group-row {
        border-top-left-radius: 6px;
    }

    .group-row:last-child {
        border-bottom-left-radius: 6px;
    }
}


/* 첫 번째 행은 항상 테두리 표시 (제거) */
.defense-table tr:last-child td,
.penetrate-table tr:last-child td {
    border-bottom: 1px solid rgb(255, 255, 255, 0.1);
}

/* 테이블 헤더 스타일 */
.defense-table th,
.penetrate-table th {
    padding: 10px 8px 15px 8px;
    /* 상 우 하 좌 패딩 */
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    /* 헤더 아래 구분선 추가 */
    color: rgba(255, 255, 255, 0.6);
    /* 헤더 텍스트 색상 */
    font-weight: 800;
    /* 폰트 두께 */
}

/* 테이블 셀 스타일 */
.defense-table td,
.penetrate-table td {
    vertical-align: middle;
    padding: 8px;
}


/* 광역 또는 단일/광역인 경우 색상 변경 */
.target-column[data-target="광역"] {
    color: rgb(221, 132, 132, 0.5);
    /* 붉은 계열 색상 */
}

.target-column[data-target="단일"] {
    color: rgba(208, 221, 132, 0.5);
    /* 붉은 계열 색상 */
}

/* 선택된 행의 스타일 */
.defense-table tr.selected td,
.penetrate-table tr.selected td {
    color: rgba(255, 255, 255, 0.9) !important;
}

.defense-table tr.selected .target-column[data-target="광역"],
.penetrate-table tr.selected .target-column[data-target="광역"] {
    color: rgba(221, 132, 132, 0.9) !important;
}

.defense-table tr.selected .target-column[data-target="단일"],
.penetrate-table tr.selected .target-column[data-target="단일"] {
    color: rgba(208, 221, 132, 0.9) !important;
}

.defense-table-container .defense-table tr.selected .value-column {
    color: rgba(221, 132, 132) !important;
}


.penetrate-table-container .defense-table tr.selected .value-column {
    color: #5384d8 !important;
}


/* PC 열 별 크기 지정 */
@media (min-width: 1200px) {
    .defense-table .target-column {
        width: 66px;
        box-sizing: border-box;
    }

    .defense-table .skill-icon-column {
        width: 40px;
        box-sizing: border-box;
    }

    .defense-table .skill-name-column {
        width: 240px;
        box-sizing: border-box;
    }

    .defense-table .value-column {
        width: 60px;
        box-sizing: border-box;
    }

    .defense-table .option-column {
        width: 150px;
        box-sizing: border-box;
    }

    .defense-table .duration-column {
        width: 60px;
        box-sizing: border-box;
    }

    .defense-table .note-column {
        min-width: 270px;
        box-sizing: border-box;
    }
}



/* 모바일 대응을 위한 테이블 스타일 수정 */
@media (max-width: 1200px) {

    .navigation-path,
    .header-container,
    .filter-content,
    .top-cards {
        padding-left: 0px;
        padding-right: 0px;
    }

    .defense-table,
    .penetrate-table,
    #defenseTableBody,
    #penetrateTableBody {
        background-color: none;
    }

    /* 모바일 헤더 스타일 */
    .mobile-table-header {
        display: none;
        grid-template-columns: auto auto auto auto;
        gap: 8px;
        padding: 12px;
        background: var(--card-background);
        position: sticky;
        top: 0;
        z-index: 100;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2);
        font-size: 12px;
        color: rgba(255, 255, 255, 0.6);
    }

    .mobile-header-group {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .mobile-header-group span {
        white-space: nowrap;
    }

    .defense-table,
    .penetrate-table {
        display: block;
        padding-top: 8px;
    }

    .defense-table thead,
    .penetrate-table thead {
        display: none;
    }

    .defense-table tbody,
    .penetrate-table tbody {
        display: block;
    }

    .defense-table tr:not(.group-header),
    .penetrate-table tr:not(.group-header) {
        display: grid !important;
        grid-template-areas:
            "check skill-icon skill-name skill-name value"
            "check . target-option option-column duration"
            ". . note note note";
        grid-template-columns: 32px 32px 1fr 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 8px;
        padding: 12px 12px 12px 12px;
        margin: 0 0 0px 0px;
        background: transparent;
        border-radius: 0;
    }

    /* 그룹 헤더가 아닌 일반 row는 배경색 유지 (그룹에 속하지 않은 경우) */
    .defense-table tr:not(.group-header):not(.group-row),
    .penetrate-table tr:not(.group-header):not(.group-row) {
        background: rgb(62 62 62);
        border-radius: 8px;
        margin: 0 0 8px 0px;
    }

    /* note가 비어있을 때 3행 숨김 및 gap 제거 */
    .defense-table tr.no-note:not(.group-header),
    .penetrate-table tr.no-note:not(.group-header) {
        grid-template-areas:
            "check skill-icon skill-name skill-name value"
            "check . target-option option-column duration";
        grid-template-rows: auto auto;
    }

    .defense-table tr.no-note .note-column,
    .penetrate-table tr.no-note .note-column {
        display: none;
    }

    .defense-table td,
    .penetrate-table td {
        padding: 0px;
        border: none !important;
    }

    /* 각 열의 그리드 영역 지정 */
    .check-column {
        grid-area: check;
        display: flex;
        margin-top: 4px;
    }

    .skill-icon-column {
        grid-area: skill-icon;
        display: flex;
        align-items: center;
    }

    .skill-name-column {
        grid-area: skill-name;
        display: flex;
        align-items: center;
    }

    .value-column {
        grid-area: value;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .target-column {
        grid-area: target-option;
        font-size: 12px;
    }

    .option-column {
        grid-area: option-column;
        font-size: 12px;
    }

    .duration-column {
        grid-area: duration;
        font-size: 12px;
        text-align: right;
    }

    .note-column {
        grid-area: note;
        font-size: 12px;
        height: fit-content;
        color: rgba(255, 255, 255, 0.5);
    }

    .note-column:not(:empty)::before {
        content: "💬 ";
    }

    /* 그룹 헤더와 row들을 하나의 카드로 묶기 */
    .defense-table tr.group-header,
    .penetrate-table tr.group-header {
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 12px;
        margin: 10px 0 0 0;
        background: var(--card-background);
        border-radius: 10px;
        position: relative;
        z-index: 1;
    }

    /* 그룹 헤더가 닫혀있을 때는 전체 라운드 */
    .defense-table tr.group-header.group-closed,
    .penetrate-table tr.group-header.group-closed {
        border-radius: 10px;
        margin-bottom: 10px;
    }

    /* 그룹 헤더가 열려있을 때는 상단만 라운드 */
    .defense-table tr.group-header.group-open,
    .penetrate-table tr.group-header.group-open {
        border-radius: 10px 10px 0 0;
        background: #292929;
    }

    .defense-table tr.group-header td,
    .penetrate-table tr.group-header td {
        padding: 0;
    }

    /* 그룹 row들을 카드 내부로 */
    .defense-table tr.group-row[data-group],
    .penetrate-table tr.group-row[data-group] {
        margin-left: 0;
        margin-top: 0;
        margin-bottom: 0;
        border-radius: 0;
        background: var(--card-background);
    }

    /* 같은 그룹의 첫 번째 row는 헤더 바로 아래 */
    .defense-table tr.group-header+tr.group-row[data-group],
    .penetrate-table tr.group-header+tr.group-row[data-group] {
        margin-top: 0;
    }

    /* 같은 그룹의 마지막 row는 하단 라운드 처리 (표시 중인 경우만) */
    .defense-table tr.group-row.group-last-row:not([style*="display: none"]),
    .penetrate-table tr.group-row.group-last-row:not([style*="display: none"]) {
        border-radius: 0 0 10px 10px;
        margin-bottom: 10px;
        padding-bottom: 12px;
    }

    /* 그룹 헤더 다음에 다른 그룹 헤더가 오는 경우 */
    .defense-table tr.group-header+tr.group-header,
    .penetrate-table tr.group-header+tr.group-header {
        margin-top: 10px;
    }

    /* 그룹 row들 사이의 간격 제거 */
    .defense-table tr.group-row[data-group]+tr.group-row[data-group],
    .penetrate-table tr.group-row[data-group]+tr.group-row[data-group] {
        margin-top: 0;
    }

    /* 아이콘/텍스트 크기 조정 */
    .skill-icon-column img {
        height: 24px;
        width: 24px;
    }


    /* 빈 캐릭터 행 스타일 */
    .defense-table tr.empty-char,
    .penetrate-table tr.empty-char {
        padding-top: 8px;
    }

    /* 옵션 선택 스타일 */
    .option-column select {
        width: 100%;
        padding: 4px !important;
    }

    /* note-column에 텍스트가 없으면 display: none; */
    .note-column:empty {
        display: none;
    }

    .group-header-inner {
        padding: 0px !important;
    }

}

@media screen and (max-width: 1200px) {
    .note-column:not(:empty)::before {
        content: "💬 ";
    }
}

.penetrate-table-container {
    margin: 0 20px 20px 20px;
}

.final-defense-coef {
    font-size: 12px;
    color: #5384d8;
}

.final-defense-coef2 {
    font-size: 12px;
    color: #dd8484;
}

.penetrate-table-container .value-column,
.penetrate-value {
    color: #5384d8 !important;
}

/* 탭 스타일 */
.table-tabs {
    margin: 0 0px;
    padding: 0;
    background-color: var(--card-background);
    border-radius: 10px;
}

.tab-buttons {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0 0px;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    justify-content: center;
    width: 100%;
}

.tab-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.tab-button:hover {
    color: rgba(255, 255, 255, 0.8);
}

.tab-button.active {
    color: #dd8484;
    font-weight: bold;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #dd8484;
}

/* 관통 탭 활성화 시 파란색 */
.tab-button[data-tab="penetrate"].active {
    color: #5384d8;
    font-weight: bold;
}

.tab-button[data-tab="penetrate"].active::after {
    background-color: #5384d8;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

.defense-table-container,
.penetrate-table-container {
    background-color: transparent;
    padding: 0;
    margin: 0;
}

/* 모바일 대응 */
@media (max-width: 1200px) {
    .table-tabs {
        margin: 0;
        background-color: transparent;
    }

    .tab-buttons {
        padding: 0;
        margin-bottom: 10px;
    }

    .tab-button {
        padding: 10px 15px;
        font-size: 13px;
        gap: 4px;
    }

    .tab-icon {
        width: 16px;
        height: 16px;
    }

    .input-label-icon {
        width: 16px;
        height: 16px;
    }

    .penetrate-input-group label {
        width: auto;
    }

    .tab-content {
        padding: 0;
    }

    .defense-table tr.group-header td,
    .penetrate-table tr.group-header td {
        background: none;
    }
}

/* 관통 입력 필드 스타일 */
.penetrate-input-container {
    padding: 10px 0px 20px 0px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-wrap: wrap;
    display: flex;
    column-gap: 40px;
}

.penetrate-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.penetrate-input-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    width: auto;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.input-label-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.penetrate-input-group input {
    width: 50px;
    margin-left: 10px;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #5384d8;
    font-size: 14px;
    text-align: right;
}

.penetrate-input-group input:focus {
    outline: none;
    border-color: #5384d8;
}

.penetrate-input-group span {
    margin-left: 5px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* 모바일 대응 */
@media (max-width: 1200px) {
    .penetrate-input-container {
        padding: 10px;
    }

    .penetrate-input-group label {
        width: 160px;
        font-size: 13px;
    }

    .penetrate-input-group input {
        width: 80px;
        font-size: 13px;
    }
}

/* 방깎 커스텀 입력 필드 스타일 */
.reduce-input-container {
    padding: 10px 0px 20px 0px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    flex-wrap: wrap;
    display: flex;
    column-gap: 40px;
}

.reduce-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.reduce-input-group label {
    width: auto;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reduce-input-group input {
    width: 50px;
    margin-left: 10px;
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #dd8484;
    font-size: 14px;
    text-align: right;
}

.reduce-input-group input:focus {
    outline: none;
    border-color: #dd8484;
}

.reduce-input-group span {
    margin-left: 5px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.windswept-group label {
    width: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.windswept-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.windswept-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.windswept-group input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    padding: 0 !important;
    margin-right: 4px;
    opacity: 0.8;
    background-color: transparent;
    border: none;
}

.windswept-group input[type="checkbox"]:checked {
    width: 20px !important;
    height: 20px !important;
}

.windswept-group .tooltip-icon {
    font-size: 10px;
    margin-left: 4px;
    width: 16px;
    height: 16px;
    align-self: center;
}

@media (max-width: 1200px) {
    .reduce-input-container {
        padding: 10px;
    }

    .reduce-input-group label {
        width: 160px;
        font-size: 13px;
    }

    .reduce-input-group input {
        width: 80px;
        font-size: 13px;
    }
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    cursor: help;
    position: relative;
    color: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
    align-self: center;
}

.tooltip-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.tooltip-icon:hover::after {
    content: none;
}

.tooltip-icon:hover::before {
    content: none;
}

.tooltip-icon:hover {
    color: rgba(255, 255, 255, 0.8);
}




/* J&C Desire Level Control Styling */
.jc-desire-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    /* 이름 옆 간격 */
    padding: 2px 8px;
    border-radius: 4px;
}

.jc-desire-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.jc-desire-input {
    width: 60px;
    /* 소수점 입력을 위해 너비 확보 */
    padding: 4px 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: rgb(255, 255, 255, 0.8);
    font-size: 13px;
    text-align: right;
}

.jc-desire-input:focus {
    outline: none;
    border-color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
}

/* 모바일 대응: 줄바꿈 처리 */
@media (max-width: 768px) {
    .jc-desire-container {
        margin-left: 0;
        margin-top: 4px;
        width: 100%;
        box-sizing: border-box;
        justify-content: space-between;
    }

    .header-container h1 {
        font-size: 24px;
    }
}
