/* 카드 스타일 */

.main-content {
    background-color: transparent;
    width: 100%;
}

.revelation-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 20px;
    justify-content: left;
    padding: 20px 0px;
}

.card {
    --section-card-paint-inset: -2px -2px -3px;
    position: relative;
    width: 100%;
    cursor: pointer;
    padding: 18px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
    box-sizing: border-box;
    border: 2px solid transparent;
    border-bottom-width: 3px;
}

/* Cards arrive in quick order without delaying interaction or page content. */
.revelation-card-enter {
    animation: revelation-card-enter 340ms cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--revelation-card-delay, 0ms);
}

@keyframes revelation-card-enter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .revelation-card-enter {
        animation: none;
    }
}

.img-container {
    position: relative;
    flex: 0 0 90px;
}

.revelation-img {
    width: 100%;
    border: 4px solid black;
    border-radius: 8px;
}

@media (prefers-reduced-motion: no-preference) {
    .img-container > :is(.revelation-img, .name-img):not(.revelation-image-loaded) {
        opacity: 0;
    }

    .img-container > .revelation-image-loaded {
        animation: revelation-image-enter 240ms ease-out both;
    }
}

@keyframes revelation-image-enter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 1200px) {
    .revelation-img {
        width: 60px;
    }


    .img-container {
        position: relative;
        flex: 0 0 60px;
    }

    .card {
        gap: 16px;
    }

    .set-label {
        font-size: 11px !important;
    }

    .effect-set {
        grid-template-columns: 48px 1fr !important;
        padding: 10px !important;
    }

}

.name-img {
    position: absolute;
    bottom: 7%;
    left: 53%;
    transform: translateX(-48%);
    width: 40%;
    z-index: 2;
}

.info-container {
    flex: 1;
    min-width: 200px;
    width: 100%;
    color: #fff;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 호버 시 카드 이미지 색이 빛나는 효과*/
.card:hover {
    filter: brightness(1.1);
    z-index: 1;
}

/* 활성화된 카드 스타일 (선택/필터됨) */
.card.active {
    --section-card-accent: #d65b5b;
    z-index: 2;
}

.card.active::before {
    content: "";
    position: absolute;
    inset: var(--section-card-paint-inset);
    z-index: 1;
    border: 2px solid var(--section-card-accent);
    border-bottom-width: 3px;
    pointer-events: none;
}

/* 확장된 카드 스타일 (아코디언 열림) */
.card.expanded {
    z-index: 2;
}

/* Both active and expanded */
.type-label {
    font-size: 16px;
    font-weight: 700;
    color: rgb(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

.type-label-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.type-icons {
    display: flex;
    gap: 0px;
}

.type-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    transform: translateY(1px);
}

.effects-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.effect-set {
    display: grid;
    min-width: 200px;
    grid-template-columns: 60px 1fr;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.set-label {
    color: rgb(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 12px;
    margin-right: 2px;
}

.set-desc {
    font-size: 13px;
    color: rgb(255, 255, 255, 0.7);
    word-break: break-word;
    overflow-wrap: break-word;
}

@media (max-width: 1024px) {
    .revelation-cards {
        grid-template-columns: 1fr;
        /* 화면이 좁아지면 한 열로 변경 */
    }

    .card {
        justify-content: center;
    }

    .set-desc {
        font-size: 12px;
    }

}

/* 필터 섹션 스타일 */
.filter-section {
    /* background-color: #1a1919;*/
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    /* For absolute positioning if needed */
}

.reset-filter-container {
    display: flex;
    justify-content: flex-end;
    /* Right align */
    margin-top: 10px;
    padding-right: 4px;
}

.reset-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.reset-filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.reset-filter-btn svg {
    width: 14px;
    height: 14px;
}

.filter-header {
    display: none;
    /*display: flex; align-items: center; padding: 0px 12px 10px 12px;*/
}


.filter-content {
    padding: 0px 0px 0px 0px;
}

.filter-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 4px;
    gap: 4px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h3 {
    width: 60px;
    color: rgb(255, 255, 255, 0.8);
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 400;
    outline: none;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin-right: 0px;
    padding-right: 0px;
}

.filter-options label {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    border-radius: var(--filter-icon-corner);
    padding: 0px 6px 0px 6px;
    transition: all 0s;
    /* background-color만이 아닌 모든 속성에 transition 적용 */
    background-color: var(--card-background);
    outline: none;
}

.filter-options label:hover {
    filter: brightness(1.1);
    background-color: rgb(255, 255, 255, 0.4);
}

/* 체크박스가 체크되었을 때 라벨 스타일 변경 */
.filter-options input[type="checkbox"]:checked+img,
.filter-options input[type="checkbox"]:checked+.star-container {
    filter: brightness(1.2);
}

.filter-options input[type="checkbox"]:checked~label,
.filter-options label:has(input[type="checkbox"]:checked) {
    background-color: rgba(0, 0, 0, 0.15);
    height: 32px;
    padding: 0px 6px 0px 6px;
    box-shadow: 0 0 0 1px #ff00007c inset;
}

.filter-options img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.filter-options img[src*="icon-일.png"],
.filter-options img[src*="icon-월.png"],
.filter-options img[src*="icon-성.png"],
.filter-options img[src*="icon-진.png"] {
    transform: translateY(2px);
}


.filter-options input[type="checkbox"] {
    display: none;
    width: 16px;
    height: 16px;
}

.filter-options p {
    font-size: 11px;
    font-weight: 400;
    padding: 0px 6px 0px 6px;
    color: rgb(255, 255, 255, 0.9);
}


.separator-line {
    padding: 0 20px;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right,
            transparent,
            rgba(255, 255, 255, 0.1) 10%,
            rgba(255, 255, 255, 0.1) 90%,
            transparent);
    margin: 0px 0 24px 0;
    box-sizing: border-box;
}


@media (max-width: 1440px) {
    .main-wrapper {
        padding-top: 60px;
    }

    .filter-header {
        display: none;
    }

    .filter-header,
    .filter-section {
        /* background-color: #1a1919;*/
        padding-top: 0;
        margin-top: 0;
        overflow: hidden;
    }

    .filter-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-group h3 {
        margin-bottom: 4px;
    }

    .filter-content {
        margin-bottom: 10px;
    }

}

/* 모바일 화면 레이아웃 조정 */
@media (max-width: 1200px) {

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

    .header-container h1 {
        margin-bottom: 0px;
    }

    .card {
        flex-direction: row;
        padding-left: 10px;
        padding-right: 10px;
    }

    .info-container {
        min-width: none;
        width: 100%;
    }
}

/* Search section styles */
.search-section {
    position: relative;
    padding: 0 0px;
    margin-bottom: 4px;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-container {
    position: relative;
    align-items: center;
    max-width: 260px;
    box-sizing: border-box;
}

.search-count {
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
    white-space: nowrap;
}

/* 모바일 화면 레이아웃 조정 */
@media (max-width: 1200px) {
    .search-section {
        padding: 0px;
        width: 100%;
    }
}

/* Accordion (characters using this revelation) */
.accordion {
    width: 100%;
    margin-top: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.15);
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.25);
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    padding: 10px 12px;
    cursor: pointer;
    border: none;
}

.accordion-header:hover {
    background: rgba(255, 0, 0, 0.25);
    /* Explicit hover bg */
    filter: brightness(1.1);
}

.accordion-content {
    display: none;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

.accordion-content.open {
    display: block;
}

.user-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-tag {
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

/* Character link items inside accordion */
.character-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.95);
    padding: 0px 12px 0px 0px;
    border-radius: 999px;
    font-size: 12px;
    text-decoration: none;
}

.character-link:focus-visible {
    outline: 2px solid #ff9ea8;
    outline-offset: 2px;
}

.character-link:not(.spoiler):focus-visible {
    background: #4a2c30;
    box-shadow: inset 0 0 0 1px #9c565c;
}

@media (hover: hover) and (pointer: fine) {
    .character-link:not(.spoiler):hover {
        background: #4a2c30;
        box-shadow: inset 0 0 0 1px #9c565c;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .character-link {
        transition: background-color 160ms ease, box-shadow 160ms ease,
            transform 180ms cubic-bezier(.2, .7, .2, 1);
    }

    .character-link .character-img {
        transition: transform 180ms cubic-bezier(.2, .7, .2, 1);
    }

    .character-link:not(.spoiler):focus-visible {
        transform: translateY(-2px) scale(1.04);
    }

    .character-link:not(.spoiler):focus-visible .character-img {
        transform: scale(1.13);
    }

    @media (hover: hover) and (pointer: fine) {
        .character-link:not(.spoiler):hover {
            transform: translateY(-2px) scale(1.04);
        }

        .character-link:not(.spoiler):hover .character-img {
            transform: scale(1.13);
        }
    }
}

.character-link.spoiler {
    position: relative;
    cursor: pointer;
    opacity: 0.58;
    background: rgba(0, 0, 0, 0.52);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.character-link.spoiler .character-img,
.character-link.spoiler .character-name,
.character-link.spoiler .char-icons {
    filter: blur(4px) brightness(0.62);
    user-select: none;
    -webkit-user-select: none;
}

.character-link.spoiler::after {
    content: 'SPOILER';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 2;
    pointer-events: none;
}

.character-img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    background: #222;
}

.character-name {
    line-height: 1;
}

/* Character icons (position/element) */
.char-icons {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.char-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* Priority highlight parity with wonder-weapon */
.character-link.priority .character-img {
    border: 1px solid #000;
    border-color: #ff0000;
    box-shadow: 0 0 0 1px rgba(255, 0, 0, 0.5);
}

/* Revelation Stats Accordion */
.rev-stats-section {
    margin: 16px 0 10px;
    padding: 0 0px;
}

.rev-stats-section:not(:has(.rev-accordion.open)) {
    --section-card-fill: rgba(58, 58, 58, 0.95);
}

.rev-stats-section:has(.rev-accordion:not(.open):is(:hover, :focus-visible)) {
    --section-card-fill: rgba(68, 68, 68, 0.98);
}

@media (max-width: 1200px) {
    .rev-stats-section {
        padding: 0px;
    }
}

.rev-accordion {
    width: 100%;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    cursor: pointer;
    text-align: left;
    transition: background-color .18s ease, border-color .18s ease;
}

.rev-accordion:hover,
.rev-accordion:focus-visible {
    border-color: rgba(255, 255, 255, 0.2);
}

.rev-accordion:not(.open) {
    border-color: transparent;
}

.rev-accordion.open {
    background: rgba(58, 58, 58, 0.95);
}

.rev-accordion.open:is(:hover, :focus-visible) {
    background: rgba(68, 68, 68, 0.98);
}

.rev-accordion:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 2px;
}

.rev-accordion-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rev-stats-title {
    font-weight: 700;
    line-height: 1.2;
}

.rev-stats-helper {
    color: rgba(255, 255, 255, 0.66);
    font-size: 12px;
    line-height: 1.35;
}

.rev-accordion-indicator {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.88);
}

.rev-accordion-action {
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
}

.rev-accordion .chev {
    transition: transform .2s ease;
}

.rev-accordion.open .chev {
    transform: rotate(180deg);
}

.rev-panel {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: none;
    border-bottom-color: transparent;
    padding: 16px 12px 20px 12px;
}

@media (max-width: 640px) {
    .rev-accordion {
        align-items: flex-start;
        padding: 12px;
    }

    .rev-accordion-indicator {
        padding-top: 1px;
    }

    .rev-stats-helper {
        font-size: 11px;
    }
}

.rev-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.rev-tab {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.rev-tab.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.18);
}

.rev-tab img {
    width: 18px;
    height: 18px;
}

.rev-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.1);
}

.rev-tab-panel > .rev-table-wrap:last-child {
    clip-path: var(--section-card-tail-shape);
}

table.rev-table {
    width: 100%;
    border-collapse: collapse;
    color: #fff;
    font-size: 13px;
    table-layout: fixed;
}

table.rev-table th,
table.rev-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

table.rev-table th {
    background: rgba(255, 255, 255, 0.06);
    text-align: left;
}

.rev-subsection-title {
    margin: 24px 0 10px 2px;
    font-weight: 700;
    color: #fff;
}

@media (max-width: 640px) {
    table.rev-table {
        font-size: 12px;
    }

    .rev-tab {
        padding: 5px 8px;
    }
}

/* Fixed column widths per table type (consistent across tabs) */
table.rev-table-main th:nth-child(1),
table.rev-table-main td:nth-child(1) {
    width: 29%;
    overflow: hidden;
    text-overflow: ellipsis;
}

table.rev-table-main th:nth-child(2),
table.rev-table-main td:nth-child(2) {
    width: 35.5%;
}

table.rev-table-main th:nth-child(3),
table.rev-table-main td:nth-child(3) {
    width: 35.5%;
}

table.rev-table-sub th:nth-child(1),
table.rev-table-sub td:nth-child(1) {
    width: 30%;
    overflow: hidden;
    text-overflow: ellipsis;
}

table.rev-table-sub th:nth-child(2),
table.rev-table-sub td:nth-child(2) {
    width: 14%;
}

table.rev-table-sub th:nth-child(3),
table.rev-table-sub td:nth-child(3) {
    width: 14%;
}

table.rev-table-sub th:nth-child(4),
table.rev-table-sub td:nth-child(4) {
    width: 14%;
}

table.rev-table-sub th:nth-child(5),
table.rev-table-sub td:nth-child(5) {
    width: 14%;
}

table.rev-table-sub th:nth-child(6),
table.rev-table-sub td:nth-child(6) {
    width: 14%;
}

/* Highlight columns: Sub Stats 1st, Main Stats MAX (LV25) */
table.rev-table-sub th:nth-child(2),
table.rev-table-sub td:nth-child(2) {
    color: #ffcc33;
}

table.rev-table-main th:nth-child(2),
table.rev-table-main td:nth-child(2) {
    color: #ffcc33;
}

.rev-stat-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-width: 0;
    vertical-align: middle;
}

.rev-stat-icon {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    object-fit: contain;
}

.rev-label-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Pink-highlight for specific option labels (moon/star/sky main stats) */
.rev-label-pink {
    color: #ffd1d1;
}
