@charset "utf-8";
@import url('style.css');

/* ===== Character Interaction - View Styles ===== */

/* 전체 래퍼 */
.ci-view-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: var(--panel-bg);
}

/* 테마: white */
.ci-view-wrap.white {
    --panel-bg: rgba(255, 255, 255, 0.95);
    --panel-text: #333;
    --panel-border: rgba(0, 0, 0, 0.1);
    --panel-muted: #666;
    --panel-hover: rgba(0, 0, 0, 0.05);
}

/* 테마: black (기본) */
.ci-view-wrap.black {
    --panel-bg: rgba(15, 15, 15, 0.95);
    --panel-text: #f0f0f0;
    --panel-border: rgba(255, 255, 255, 0.1);
    --panel-muted: #999;
    --panel-hover: rgba(255, 255, 255, 0.05);
}

/* 배경 이미지 */
.ci-view-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-image) center center / cover no-repeat;
    filter: blur(4px);
    transform: scale(1.1);
    z-index: 0;
}

/* ===== 액션 바 (상단 고정) ===== */
.ci-action-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
    z-index: 100;
}

.ci-action-left,
.ci-action-right {
    display: flex;
    align-items: center;
    gap: 80px;
}

.ci-btn-back,
.ci-btn-action {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.ci-btn-back:hover,
.ci-btn-action:hover {
    background: rgba(255,255,255,0.2);
}

/* BGM 플레이어 */
.ci-bgm-player {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ci-bgm-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
}

.ci-bgm-volume {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

.ci-bgm-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* ===== 메인 컨테이너 ===== */
.ci-view-container {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    z-index: 1;
}

/* ===== 좌측 사이드바 (fixed) ===== */
.ci-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 80px 5px 20px 0;
    background: linear-gradient(90deg, var(--panel-bg) 90%, transparent 100%);
    backdrop-filter: blur(10px);
    z-index: 50;
}

/* 탭 네비게이션 */
.ci-tab-nav {
    display: flex;
    flex-direction: column;
}

.ci-tab-btn {
    position: relative;
    padding: 16px 20px;
    background: none;
    border: none;
    text-align: left;
    font-size: 13px;
    color: var(--panel-muted);
    cursor: pointer;
    transition: all 0.3s;
}

.ci-tab-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--char-color);
    transition: height 0.3s;
}

.ci-tab-btn:hover {
    color: var(--panel-text);
    background: var(--panel-hover);
}

.ci-tab-btn.active {
    color: var(--panel-text);
    font-weight: 600;
}

.ci-tab-btn.active::before {
    height: 20px;
}

/* 사이드바 하단 */
.ci-sidebar-bottom {
    padding: 0 15px;
}

.ci-sidebar-portrait {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--char-color);
}

.ci-sidebar-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ci-sidebar-stats {
    font-size: 11px;
}

.ci-stats-label {
    display: block;
    font-size: 0.8em;
    color: var(--panel-muted);
    letter-spacing: 2px;
    margin-bottom: 3px;
}

.ci-mini-stat {
    margin-bottom: 6px;
}

.ci-mini-stat-name {
    display: block;
    font-size: 10px;
    color: var(--panel-muted);
    margin-bottom: 2px;
}

.ci-mini-stat-bar {
    height: 4px;
    background: var(--panel-border);
    border-radius: 2px;
    overflow: hidden;
}

.ci-mini-stat-fill {
    height: 100%;
    background: var(--char-color);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* HP/MP 바 */
.ci-hp-bar,
.ci-mp-bar {
    position: relative;
    height: 16px;
    background: var(--panel-border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.ci-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #c0392b, #e74c3c);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.ci-mp-fill {
    height: 100%;
    background: linear-gradient(90deg, #2980b9, #3498db);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.ci-bar-text {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    z-index: 1;
}

/* ===== 메인 영역 (스크롤 가능) ===== */
.ci-main {
    width: 100%;
    position: absolute;
    left: 120px;
    right: 280px;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.ci-view-wrap .ra0-content,
.ci-view-wrap .ra0-content h2,
.ci-view-wrap .ra0-content h3,
.ci-view-wrap .ra0-content h4,
.ci-view-wrap .ci-tab-btn {
    font-family: var(--f-pre);
    color: var(--panel-text);
}

.ci-view-wrap.tab-open .ci-main {
    right: 0;
}

.ci-view-wrap.tab-open .ci-bottom-fixed {
    opacity: 0;
    pointer-events: none;
}

/* 탭 패널 열림 시 정보 패널 토글 버튼 비활성화 */
.ci-view-wrap.tab-open #btn-toggle-panel {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

/* 전신 이미지 영역 */
.ci-body-area {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    min-height: 100%;
    padding: 60px 400px 40px 40px; /* 기본: 패널 열림 상태 */
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

/* 패널 숨김 시 패딩 축소 */
.ci-view-wrap.panel-closed .ci-body-area {
    padding: 60px 40px 40px;
}

.ci-body-area.shifted {
    transform: translateX(20%);
}

.ci-body-image {
    position: relative;
    max-width: 100%;
    text-align: center;
}

.ci-body-image img {
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(40px 10px 0px var(--char-color));
}

/* 잔물결 클릭 이펙트 */
.ci-aurora-effect {
    position: fixed;
    pointer-events: none;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 1px solid rgba(255, 220, 150, 0.6);
    box-shadow: 0 0 6px rgba(255, 200, 100, 0.3);
    animation: ripple 0.8s ease-out forwards;
    z-index: 9999;
}

.ci-aurora-effect::before,
.ci-aurora-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid rgba(255, 220, 150, 0.4);
    animation: ripple 0.8s ease-out forwards;
}

.ci-aurora-effect::before {
    width: 40px;
    height: 40px;
    animation-delay: 0.15s;
}

.ci-aurora-effect::after {
    width: 20px;
    height: 20px;
    animation-delay: 0.3s;
}

@keyframes ripple {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

/* 하단 고정 영역 (커스텀 스탯 + 한마디) */
.ci-bottom-fixed {
    position: fixed;
    left: 120px;
    bottom: 0;
    width: calc(100% - 520px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 10;
}

/* 커스텀 스탯 표시 */
.ci-custom-stats-display {
    display: flex;
    gap: 5px;
    min-width: 120px;
    max-width: 300px;
    padding: 0 0 20px 30px;
    flex-direction: column;
}

.ci-custom-stat-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.ci-custom-stat-name {
    font-size: 12px;
    color: var(--panel-muted);
    text-shadow: 0 0 3px var(--black), 0 0 10px rgb(from var(--gray-700) r g b / 70%);
}

.ci-custom-stat-name::before {
    content: '✦';
    margin-right: 4px;
    color: var(--char-color);
}

.ci-custom-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--char-color);
}

/* 한마디 */
.ci-oneline {
    width: 100%;
    padding: 0px 15px 20px;
    /* background: linear-gradient(103deg, var(--panel-bg) 70%, transparent 100%); */
    /* backdrop-filter: blur(4px); */
    user-select: none;
    display: flex;
    flex-direction: row;
    gap: 15px;
}

/* .ci-oneline::before {
    content: '';
    position: absolute;
    right: 100%;
    top: 70%;
    width: 150px;
    height: 0.5px;
    background: linear-gradient(to right, transparent 0%, rgb(from var(--char-color) r g b / 60%) 100%);
    transform: rotate(-20deg);
    transform-origin: right center;
} */

.ci-oneline-label {
    display: block;
    font-size: 0.7em;
    color: var(--panel-muted);
    letter-spacing: 2px;
}

.ci-oneline-label::before, .ci-stats-label::before {
    content: '✦';
    margin-right: 5px;
    color:  var(--char-color);
}

.ci-oneline-text {
    margin-left: 5px;
    font-size: 1.7rem;
    font-style: italic;
    font-family: chosunsm;
    color: #fff;
    line-height: 1.5;
    transition: opacity 0.3s;
    max-width: 100%;
    padding-right: 170px;
    padding-bottom: 5px;
    text-shadow: 0 0 3px var(--black), 0 0 10px rgb(from var(--gray-700) r g b / 70%);
}

.ci-oneline-text.fade {
    animation: fadeText 0.3s ease;
}

@keyframes fadeText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ===== 탭 패널 (좌→우 슬라이드) ===== */
.ci-tab-panel {
    position: fixed;
    left: 95px;
    top: 0;
    width: calc(50% - 60px);
    height: 100%;
    max-width: 1000px;
    background: linear-gradient(to right, var(--panel-bg) 0%, var(--panel-bg) 90%, transparent 100%);
    transform: translateX(-100%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 20;
    overflow-y: auto;
}

.ci-view-wrap.white .ci-tab-panel {
    background: linear-gradient(to right,
        var(--panel-bg) 0%,
        var(--panel-bg) 70%,
        rgba(255, 255, 255, 0.8) 85%,
        transparent 100%
    );
}

.ci-tab-panel.open {
    transform: translateX(0);
    opacity: 1;
}

.ci-tab-panel-content {
    padding: 80px 100px;
    padding-right: 200px;
    max-width: 100%;
}

.ci-tab-content {
    display: none;
}

.ci-tab-content.active {
    display: block;
    animation: fadeInContent 0.4s ease;
}

@keyframes fadeInContent {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.ci-tab-body {
    font-size: 1.0em;
    font-family: var(--f-pre);
    line-height: 1.8;
    color: var(--panel-text);
}

.ci-tab-body .ra0-content,
.ci-tab-body .ra0-content blockquote {
    font-size: 1.0em;
    font-family: var(--f-pre);
    line-height: 1.8;
    color: var(--panel-text);
}

/* 스탯 그리드 */
.ci-stats-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ci-stat-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--panel-border);
}

.ci-stat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ci-stat-name {
    font-size: 13px;
    color: var(--panel-text);
}

.ci-stat-value {
    font-size: 12px;
    color: var(--panel-muted);
}

.ci-stat-bar {
    height: 6px;
    background: var(--panel-border);
    border-radius: 3px;
    overflow: hidden;
}

.ci-stat-fill {
    height: 100%;
    background: var(--char-color);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* 커스텀 스탯 (바 없이 수치만) */
.ci-stats-grid.custom {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ci-stats-grid.custom .ci-stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--panel-border);
}

.ci-stats-grid.custom .ci-stat-header {
    display: contents;
    margin-bottom: 0;
}

.ci-stats-grid.custom .ci-stat-name {
    font-size: 13px;
    color: var(--panel-text);
}

.ci-stats-grid.custom .ci-stat-name::before {
    content: '✦';
    margin-right: 5px;
    color: var(--char-color);
}

.ci-stats-grid.custom .ci-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--char-color);
}

.ci-stats-grid.custom .ci-stat-bar {
    display: none;
}

/* 관계 그리드 */
.ci-relations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ci-relation-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--panel-hover);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.ci-relation-card:hover {
    background: var(--panel-border);
}

.ci-relation-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ci-relation-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ci-relation-thumb i {
    color: var(--panel-muted);
}

.ci-relation-info {
    flex: 1;
    min-width: 0;
}

.ci-relation-type {
    display: block;
    font-size: 10px;
    color: var(--char-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ci-relation-name {
    display: block;
    font-size: 13px;
    color: var(--panel-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 우측 정보 패널 (fixed) ===== */
.ci-info-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    padding: 80px 25px 30px 40px;
    background: linear-gradient(270deg, var(--panel-bg) 95%, transparent 100%);
    backdrop-filter: blur(10px);
    overflow-y: auto;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
    display: flex;
    flex-direction: column;
}

.ci-info-panel.hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

.ci-info-panel.force-show {
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* 정보 패널 숨김 (토글) */
.ci-info-panel.panel-hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
}

/* 토글 버튼 활성 상태 */
.ci-btn-action.active {
    background: var(--char-color);
    border-color: var(--char-color);
    color: #fff;
}

/* 이름 영역 (중앙 정렬) */
.ci-name-area {
    text-align: center;
    margin-bottom: 10px;
}

/* 등급 */
.ci-info-rank {
    display: flex;
    justify-content: center;
    gap: 2px;
    color: var(--char-color);
    font-size: 2.5rem;
}

/* 영문명 (위, 크게) */
.ci-char-name-en {
    font-size: 3.5rem;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--panel-text);
    line-height: 1;
    margin-top: -10px;
    padding: 0 20px;
    margin-bottom: 5px;
}

/* 영문명 언어별 폰트 */
.ci-char-name-en.cjk-ja {
    font-family: 'Noto Serif JP', serif;
    font-style: normal;
}

.ci-char-name-en.cjk-zh {
    font-family: 'Noto Serif SC', serif;
    font-style: normal;
}

/* 한글 이름 (아래, 작게) */
.ci-char-name-kr {
    margin: 0;
    font-size: 13px;
    color: var(--panel-muted);
    font-family: 'Pretendard', 'Noto Sans KR', sans-serif;
}

/* 기본 정보 (가로 배치) */
.ci-basic-info-line {
    text-align: center;
    font-size: 12px;
    color: var(--panel-muted);
    margin-bottom: 30px;
}

.ci-info-divider {
    border: none;
    height: 1px;
    background: var(--panel-border);
    margin: 15px 0;
}

/* 소개 */
.ci-intro {
    position: relative;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: linear-gradient(103deg, var(--panel-hover) 70%, transparent 100%);
    backdrop-filter: blur(4px);
    border-radius: 6px;
    border-left: 2px solid var(--char-color);
}

.ci-intro-content .ra0-content {
    font-size: 1em;
    line-height: 1.6;
    color: var(--panel-text);
    overflow-y: auto;
    text-align: justify;
}

.ci-intro-content::-webkit-scrollbar {
    width: 4px;
}

.ci-intro-content::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 2px;
}

/* 섹션 타이틀 */
.ci-section-title {
    margin: 0 0 5px;
    font-size: 1em;
    color: var(--panel-muted);
}

.ci-section-title::before {
    content: '✦';
    margin-right: 4px;
    color: var(--char-color);

}

/* 인벤토리 */
.ci-inventory {
    margin-bottom: 20px;
}

.ci-inventory-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.ci-inventory-slot {
    aspect-ratio: 1;
    background: var(--panel-hover);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ci-inventory-slot.has-item {
    background: var(--panel-border);
}

.ci-inventory-slot img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.ci-item-placeholder {
    font-size: 12px;
    color: var(--panel-muted);
}

.ci-item-qty {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 9px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 1px 4px;
    border-radius: 3px;
}

/* 아이템 툴팁 */
.ci-item-tooltip {
    position: fixed;
    z-index: 9999;
    min-width: 180px;
    max-width: 280px;
    padding: 12px 14px;
    background: rgba(20, 20, 25, 0.95);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.15s, transform 0.15s;
}

.ci-item-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.ci-item-tooltip-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #fff;
}

.ci-item-tooltip-name.rarity-common { color: #b0b0b0; }
.ci-item-tooltip-name.rarity-uncommon { color: #4ade80; }
.ci-item-tooltip-name.rarity-rare { color: #60a5fa; }
.ci-item-tooltip-name.rarity-epic { color: #c084fc; }
.ci-item-tooltip-name.rarity-legendary { color: #fbbf24; }

.ci-item-tooltip-qty {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
}

.ci-item-tooltip-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    line-height: 1.5;
}

/* 전신 갤러리 */
.ci-body-gallery {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ci-body-thumb {
    width: 50px;
    height: 50px;
    padding: 0;
    background: var(--panel-hover);
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s;
}

.ci-body-thumb.active {
    border-color: var(--char-color);
}

.ci-body-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 네비게이션 버튼 */
.ci-nav-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 20px;
}

.ci-nav-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-hover);
    border: 1px solid var(--panel-border);
    border-radius: 50%;
    color: var(--panel-text);
    text-decoration: none;
    transition: all 0.2s;
}

.ci-nav-btn:hover {
    background: var(--panel-border);
    border-color: var(--char-color);
}

/* 스크롤바 */
.ci-main::-webkit-scrollbar,
.ci-tab-panel::-webkit-scrollbar,
.ci-info-panel::-webkit-scrollbar {
    width: 6px;
}

.ci-main::-webkit-scrollbar-track,
.ci-tab-panel::-webkit-scrollbar-track,
.ci-info-panel::-webkit-scrollbar-track {
    background: transparent;
}

.ci-main::-webkit-scrollbar-thumb,
.ci-tab-panel::-webkit-scrollbar-thumb,
.ci-info-panel::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 3px;
}

/* ===== 반응형 ===== */
@media (max-width: 1200px) {
    .ci-sidebar {
        width: 80px;
    }

    .ci-tab-btn {
        padding: 12px 10px;
        font-size: 11px;
    }

    .ci-main {
        left: 80px;
        right: 0;
    }

    .ci-info-panel {
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
    }

    .ci-info-panel.force-show {
        transform: translateX(0);
        opacity: 1;
        pointer-events: auto;
    }

    .ci-tab-panel {
        width: 70%;
    }

    .ci-sidebar-bottom {
        display: none;
    }
}

@media (max-width: 768px) {
    .ci-sidebar {
        width: 60px;
        padding: 10px 0;
    }

    .ci-tab-text {
        display: none;
    }

    .ci-tab-btn {
        padding: 14px;
        text-align: center;
    }

    .ci-tab-btn::after {
        content: '';
        display: block;
        width: 20px;
        height: 2px;
        background: var(--panel-muted);
        margin: 0 auto;
    }

    .ci-tab-btn.active::after {
        background: var(--char-color);
    }

    .ci-main {
        left: 60px;
    }

    .ci-body-area {
        padding: 40px 20px;
    }

    .ci-oneline {
        left: 10px;
        top: 60px;
        max-width: 200px;
        padding: 10px 15px;
    }

    .ci-tab-panel {
        width: 90%;
    }

    .ci-tab-panel-content {
        padding: 30px 20px;
    }

    .ci-info-panel {
        width: 100%;
    }

    .ci-relations-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 우측 하단 버튼들 ===== */
.ci-bottom-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    z-index: 100;
}

.ci-bottom-buttons button,
.ci-bottom-buttons a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 50%;
    color: var(--panel-text);
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.ci-bottom-buttons button:hover,
.ci-bottom-buttons a:hover {
    background: var(--char-color);
    border-color: var(--char-color);
    color: #fff;
    transform: scale(1.1);
}

/* 삭제 버튼 호버 (빨간색) */
.ci-btn-delete:hover {
    background: #e74c3c !important;
    border-color: #e74c3c !important;
}

/* etc 버튼 래퍼 */
.ci-btn-etc-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* etc 목록 (캐릭터 버전들) */
.ci-etc-list {
    display: flex;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.ci-etc-list.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.ci-etc-item {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    border-radius: 6px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.2s ease;
}

.ci-etc-item:hover {
    border-color: var(--char-color);
    transform: scale(1.05);
}

.ci-etc-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ci-etc-placeholder {
    font-size: 16px;
    color: var(--panel-muted);
}

.ci-btn-etc.active {
    background: var(--char-color);
    border-color: var(--char-color);
    color: #fff;
}

/* ===== 옷장 오버레이 ===== */
.ci-wardrobe-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.ci-wardrobe-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.ci-wardrobe-content {
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    padding: 40px;
    position: relative;
}

.ci-wardrobe-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.ci-wardrobe-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.ci-wardrobe-title {
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.6);
}

.ci-wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 10px;
}

.ci-wardrobe-grid::-webkit-scrollbar {
    width: 4px;
}

.ci-wardrobe-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.ci-wardrobe-item {
    aspect-ratio: 3/4;
    padding: 0;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ci-wardrobe-item:hover {
    border-color: var(--char-color);
    transform: scale(1.03);
}

.ci-wardrobe-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 반응형 - 우측 하단 버튼 */
@media (max-width: 768px) {
    .ci-bottom-buttons {
        bottom: 20px;
        right: 20px;
    }

    .ci-bottom-buttons button,
    .ci-bottom-buttons a {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .ci-etc-item {
        width: 44px;
        height: 44px;
    }

    .ci-wardrobe-content {
        padding: 20px;
    }

    .ci-wardrobe-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
}
