@charset "utf-8";

/* ============================
   기본 래퍼 (배경 대비 보정)
============================ */
.trpg-char-board {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
    color: #2b2b2b;
    box-sizing: border-box;
}

.list-container-box,
.write-box {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* ============================
   리스트 페이지
============================ */
.list-header-area {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

#bo_cate_ul {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}
#bo_cate_ul li {
    display: inline-block;
}
#bo_cate_ul a {
    display: block;
    padding: 7px 16px;
    border-radius: 20px;
    background: #f1f3f5;
    color: #495057;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}
#bo_cate_ul #bo_cate_on {
    background: #212529;
    color: #fff;
}

.btn-write {
    display: inline-block;
    padding: 8px 18px;
    background: var(--btn-primary-bg, #f39c12);
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
    transition: background 0.2s;
}
.btn-write:hover {
    background: var(--accent-color, #e67e22);
}

/* 카드 그리드 */
.char-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.char-card {
    background: #fff;
    border-radius: 6px; 
    padding: 6px 6px 0 6px; 
    overflow: visible; /* 카드 바깥으로 토큰이 나가게 허용 */
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    border-bottom: 6px solid var(--theme-color);
}
.char-card:hover {
    transform: translateY(-6px) rotate(1.5deg); 
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
    z-index: 10;
}
.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative; /* 자식(토큰) 위치의 절대 기준점 */
}

/* 썸네일 내부 영역 */
.card-thumb {
    width: 100%;
    aspect-ratio: 3 / 4; 
    position: relative;
    overflow: visible; 
}
.thumb-inner {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden; /* 두상과 그라데이션만 깔끔하게 자름 */
    background: #e9ecef;
    border-radius: 2px 2px 0 0;
}
.thumb-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}
.thumb-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 65%;
    background: linear-gradient(to top, rgba(255,255,255,1) 0%, rgba(255,255,255,0.7) 40%, transparent 100%);
}

.meta-chips {
    position: absolute;
    left: -10px; 
    top: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start; 
    gap: 6px; 
    z-index: 10;
}
.chip {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #dee2e6;
    border-left: 4px solid var(--theme-color); 
    color: #495057;
    padding: 4px 10px 4px 8px; 
    border-radius: 2px 6px 6px 2px; 
    font-size: 11px;
    font-weight: 800;
    backdrop-filter: blur(4px);
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.15); 
    transition: transform 0.2s;
}
.chip:hover {
    transform: translateX(-4px); 
}
.chip.inverted-chip {
    background: var(--theme-color);
    color: #fff;
    border-color: var(--theme-color);
    border-left: 4px solid rgba(0, 0, 0, 0.2); 
}

.card-info {
    position: relative;
    z-index: 2;
    padding: 12px 4px 14px; 
    text-align: center;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 16px 24px 22px; 
    align-items: center;
    gap: 2px;
}

.char-codename {
    font-size: 11px;
    color: #868e96;
    margin-bottom: 0;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    overflow: visible; 
}

.char-codename ruby {
    ruby-position: over;
    display: inline-flex;
    flex-direction: column-reverse;
    vertical-align: bottom;
    align-items: center;
    line-height: 1;
}

.char-codename rt {
    font-size: 0.6em;
    font-weight: normal;
    color: #adb5bd;
    line-height: 1;
    margin-bottom: 1px;
}

.char-name-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    height: 100%;
}

.char-name-main {
    font-size: 16px;
    font-weight: 800;
    color: #212529;
    line-height: 1.1;
}

.char-name-sub-ruby {
    font-size: 11px;
    font-weight: 600;
    color: #868e96;
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.char-rule-wrap {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    height: 100%;
}

.char-rule-tag {
    display: inline-block;
    margin-top: 0;
    padding: 2px 8px;
    background: #212529;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: -0.2px;
}

.no-char-box {
    text-align: center;
    padding: 60px 20px;
    color: #868e96;
}
.btn-write-empty {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 20px;
    background: var(--btn-primary-bg, #f39c12);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
}
.btn-write-empty:hover {
    color: #ffffff;
    background: var(--accent-color, #e67e22);
}

/* ============================
   상세 뷰 (view.skin.php)
============================ */
.char-detail-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.box {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    box-sizing: border-box;
    padding: 24px;
}
.box-title {
    font-size: 15px;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--theme-color);
    display: inline-block;
    padding-bottom: 4px;
    color: #212529;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: fit-content;      /* flex 자식일 때 박스 끝까지 밑줄이 늘어나는 현상 방지 */
    align-self: flex-start;  /* 좌측 정렬 유지 */
}

.clickable-img-box {
    cursor: pointer;
    position: relative;
}
.zoom-hover-icon {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.clickable-img-box:hover .zoom-hover-icon {
    opacity: 1;
}

.detail-top-row {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: stretch;
}

.head-photo-box {
    padding: 0;
    overflow: hidden;
    height: 100%;
    min-height: 250px;
    border-radius: 16px;
    background: #f1f3f5;
}
.head-photo-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.modern-sheet {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
}

.speech-bubble-wrapper {
    margin-bottom: 2px;
}
.speech-bubble {
    position: relative;
    background: var(--theme-color);
    color: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}
.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 18px;
    width: 0;
    height: 0;
    border-top: 8px solid var(--theme-color);
    border-right: 8px solid transparent;
    border-left: 2px solid transparent;
}

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

.view-codename {
    font-size: 13px;
    color: #868e96;
    letter-spacing: -0.2px;
    line-height: 1.2;
}
.view-codename ruby {
    ruby-position: over;
    display: inline-flex;
    flex-direction: column-reverse;
    vertical-align: bottom;
    align-items: center;
    line-height: 1;
}
.view-codename rt {
    font-size: 0.6em;
    font-weight: normal;
    color: #adb5bd;
    line-height: 1;
    margin-bottom: 1px;
}

.view-name {
    margin: 0;
    font-size: 26px;
    font-weight: 900;
    color: #212529;
    letter-spacing: -0.5px;
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.ruby-side-txt {
    font-size: 0.55em;
    font-weight: normal;
    color: #868e96;
    letter-spacing: 0;
}

.rule-meta-badges {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.rule-badge {
    background: #212529;
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: -0.2px;
}
.meta-badge {
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    color: #495057;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 700;
}
.meta-badge.rank {
    background: #fff;
    border-color: var(--theme-color);
    color: var(--theme-color);
}
.meta-badge.syn {
    border-color: var(--theme-color);
    color: var(--theme-color);
    background: #fff;
}
.sub-info-txt {
    font-size: 12.5px;
    color: #666;
    margin-left: 4px;
    font-weight: 500;
}

/* ============================
   스탯 패널 & 대형 D-로이스 엠블럼 바
============================ */
.trpg-stat-section {
    background: #fafbfc;
    border: 1px solid #edf0f2;
    border-radius: 12px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.stat-emblem-list {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e2e6ea;
}
.stat-emblem-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.stat-emblem-item .dia-icon {
    font-size: 11px;
    color: var(--theme-color);
    transform: translateY(-2px);
}
.stat-emblem-item .emblem-lbl {
    font-size: 20px;
    font-weight: 900;
    color: #2b2b2b;
    letter-spacing: -0.5px;
}
.stat-emblem-item .emblem-val {
    font-size: 15px;
    font-weight: 800;
    color: var(--theme-color);
    font-family: -apple-system, monospace;
}

.dx-dlois-bar .emblem-lbl {
    font-size: 19px;
    font-weight: 900;
    color: #212529;
    letter-spacing: -0.3px;
}
.dlois-name-bold {
    font-size: 17px;
    font-weight: 900;
    color: var(--theme-color);
    letter-spacing: -0.4px;
    margin-left: 2px;
}
.dlois-eng-sub {
    font-size: 12.5px;
    font-weight: 500;
    color: #868e96;
    letter-spacing: 0;
    margin-left: 4px;
}
.dlois-empty-txt {
    font-size: 15px;
    color: #ced4da;
}

.stat-mini-cluster {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e9ecef;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 11.5px;
}
.stat-mini-cluster .m-lbl {
    color: #868e96;
}
.stat-mini-cluster .m-val {
    color: #212529;
    font-weight: 800;
}
.stat-mini-cluster .v-bar {
    color: #dee2e6;
}

.stat-detail-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 16px;
}
.stat-detail-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
}
.stat-detail-row.full {
    grid-column: 1 / -1;
}
.stat-detail-row .bullet {
    font-size: 10px;
    color: var(--theme-color);
    opacity: 0.8;
}
.stat-detail-row .lbl {
    color: #868e96;
    font-weight: 700;
    font-size: 11.5px;
    flex-shrink: 0;
}
.stat-detail-row .val {
    color: #2b2b2b;
    font-weight: 600;
}
.stat-detail-row .val.highlight {
    font-weight: 800;
}
.stat-detail-row .effect-txt {
    color: var(--theme-color);
    font-weight: 700;
    margin-left: 4px;
}

/* 2. 중단 행 (전신 + 디테일) */
.detail-mid-row {
    display: grid;
    grid-template-columns: 45fr 55fr; /* '%' 대신 'fr'을 사용하여 gap 포함 시 삐져나가는 현상 방지! */
    gap: 24px;
    align-items: flex-start;
}
.detail-mid-row.no-standing {
    grid-template-columns: 1fr;
}

.standing-transparent-box {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}
.standing-transparent-box img {
    width: 100%;
    max-width: 480px;
    height: auto;
    max-height: 800px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.08));
    transition: transform 0.25s ease;
}
.standing-transparent-box:hover img {
    transform: scale(1.02);
}

.char-content {
    line-height: 1.8;
    font-size: 14.5px;
    color: #333;
}

/* 3. 하단부 시나리오 & 토큰 섹션 */
.bottom-flex-wrap {
    display: flex;
    gap: 20px;
    align-items: stretch; /* 양쪽 박스의 높이를 맞춤 */
}
.scenario-bottom-box {
    flex: 1; /* 남은 공간을 모두 차지함 */
}
.scenario-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.token-bottom-box {
    width: 300px; /* 토큰 박스 고정 너비 */
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.token-standalone-box {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 10px;
}
.token-standalone-box img {
    max-width: 100%;
    max-height: 280px; /* 상세 뷰 내 토큰 크기 지정 */
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(0,0,0,0.15));
    transition: transform 0.2s ease;
}
.token-standalone-box:hover img {
    transform: scale(1.05);
}


/* 4. 하단 갤러리 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}
.gallery-item {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f9fa;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}
.gallery-item img:hover {
    transform: scale(1.05);
}

.view-footer-nav {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}
.btn-sub {
    padding: 8px 16px;
    background: #e9ecef;
    color: #495057;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}
.btn-sub:hover {
    background: #dee2e6;
}
.btn-sub.danger {
    background: #ffe3e3;
    color: #e03131;
}
.btn-sub.danger:hover {
    background: #ffc9c9;
}

/* ============================
   이미지 확대 모달
============================ */
.char-img-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}
.char-img-modal.show {
    display: flex;
}
.modal-content-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.modal-content-wrap img {
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    user-select: none;
}
.modal-close-btn {
    position: absolute;
    top: -44px;
    right: -10px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    font-weight: lighter;
    line-height: 1;
}

.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s, transform 0.2s;
    user-select: none;
    z-index: 2;
}
.modal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: translateY(-50%) scale(1.08);
}
.modal-nav-btn.prev { left: -64px; }
.modal-nav-btn.next { right: -64px; }

.modal-caption-bar {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-credit-caption {
    color: rgba(255, 255, 255, 0.95);
    font-size: 13.5px;
    font-weight: 600;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 18px;
    border-radius: 20px;
}
.modal-counter-badge {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    font-weight: 700;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 14px;
    border-radius: 20px;
    font-family: monospace;
}

/* ============================
   작성/수정 페이지
============================ */
.write-title {
    margin-top: 0;
    margin-bottom: 24px;
    font-size: 22px;
    font-weight: 800;
    border-bottom: 2px solid #212529;
    padding-bottom: 12px;
}

.form-group {
    margin-bottom: 18px;
}
.form-row {
    display: flex;
    gap: 16px;
}
.flex-1 { flex: 1; }

.label-with-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.btn-ruby-help {
    background: #e9ecef;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    color: #495057;
}
.btn-ruby-help:hover {
    background: #dee2e6;
}

.btn-sub-action {
    background: rgba(19, 197, 173, 0.1);
    color: var(--btn-primary-bg, #f39c12);
    border: 1px solid var(--btn-primary-bg, #f39c12);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-sub-action:hover {
    background: var(--btn-primary-bg, #f39c12);
    color: #fff;
}

.scenario-rows-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.scenario-row-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.scenario-row-item .sc-date {
    width: 170px;
    flex-shrink: 0;
}
.scenario-row-item .sc-title {
    flex: 1;
}
.btn-del-row {
    width: 38px;
    height: 38px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    color: #fa5252;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    transition: background 0.2s;
}
.btn-del-row:hover {
    background: #ffe3e3;
    border-color: #ffa8a8;
}

label {
    font-weight: 700;
    font-size: 14px;
    color: #343a40;
    display: block;
    margin-bottom: 6px;
}
.req { color: #e03131; }

.frm_input,
select.frm_input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
    transition: border-color 0.2s;
}
.frm_input:focus {
    border-color: var(--btn-primary-bg, #f39c12);
    outline: none;
}

.color-pick input[type="color"] {
    width: 50px;
    height: 42px;
    padding: 2px;
    border-radius: 8px;
    border: 1px solid #ced4da;
    cursor: pointer;
    background: #fff;
}

.meta-flex {
    display: flex;
    gap: 8px;
}
.field-hint {
    font-size: 12px;
    color: #868e96;
    margin-bottom: 8px;
}

.mkrg-write-subgroup {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    margin-top: 10px;
}
.subgroup-title {
    font-size: 12px;
    font-weight: bold;
    color: #495057;
    margin-bottom: 8px;
}
.meta-flex-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.frm_input.short {
    width: 80px;
}
.flex-2 { flex: 2; }

.img-upload-section {
    background: #f8f9fa;
    padding: 18px;
    border-radius: 8px;
    border: 1px dashed #ced4da;
}
.file-item-block {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #edf0f2;
}
.file-item-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.file-tag {
    display: block;
    font-size: 12px;
    font-weight: bold;
    color: #495057;
    margin-bottom: 6px;
}
.file-row-flex {
    display: flex;
    gap: 10px;
    align-items: center;
}
.file-row-flex .credit_input {
    flex: 1;
}

.thumb-mini {
    width: 64px !important;
    height: 64px !important;
    max-width: 64px !important;
    max-height: 64px !important;
    border-radius: 6px;
    overflow: hidden;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.thumb-mini img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.2s;
}
.thumb-mini:hover img {
    transform: scale(1.06);
}

.file-chip-card {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #e2e6ea;
    border-radius: 8px;
    padding: 6px 12px 6px 6px;
    margin-top: 8px;
    transition: all 0.2s ease;
}

.file-name-chip {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    background: #f1f3f5;
    padding: 4px 10px;
    border-radius: 20px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-chip-delete {
    width: 24px;
    height: 24px;
    background: #ffe3e3;
    color: #e03131;
    border: 1px solid #ffa8a8;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.2s;
}
.btn-chip-delete:hover {
    background: #fa5252;
    color: #fff;
    transform: scale(1.1);
}

.btn-add-gallery-wrap {
    margin-top: 14px;
}
.btn-add-gallery {
    width: 100%;
    padding: 10px 0;
    background: #fff;
    border: 1px dashed var(--btn-primary-bg, #f39c12);
    color: var(--btn-primary-bg, #f39c12);
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-add-gallery:hover {
    background: var(--btn-primary-bg, #f39c12);
    color: #fff;
}

.btn_confirm {
    text-align: center;
    margin-top: 30px;
}
.btn_submit {
    padding: 12px 32px;
    background: var(--btn-primary-bg, #f39c12);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.btn_submit:hover {
    background: var(--accent-color, #e67e22);
}
.btn_cancel {
    padding: 12px 24px;
    background: #868e96;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    margin-left: 8px;
    display: inline-block;
    transition: background 0.2s;
}
.btn_cancel:hover {
    background: #6c757d;
}

.rule-group-header {
    display: flex;
    align-items: flex-end;
    border-bottom: 2px solid #e9ecef; 
    padding-bottom: 8px;
    margin-top: 10px;
    margin-bottom: 20px;
}
.rule-group-header .rule-title {
    font-size: 20px;
    font-weight: 800;
    color: #212529;
    margin: 0;
    letter-spacing: -0.5px;
}

/* 상태 이상 다크 테마 */
.char-card.is-dead {
    background: #000000; 
    border-bottom-color: #000000 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); 
}
.char-card.is-dead img {
    filter: grayscale(0.9) brightness(0.6) contrast(1.2); 
}
.char-card.is-dead .thumb-gradient {
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.7) 40%, transparent 100%);
}
.char-card.is-dead .char-name-main {
    color: #ffffff; 
}
.char-card.is-dead .char-codename {
    color: #868e96;
}
.char-card.is-dead .char-rule-tag {
    background: #1a1b1c;
    color: #adb5bd;
}
.char-card.is-dead .chip:not(.inverted-chip) {
    background: rgba(33, 37, 41, 0.95);
    border-color: #111;
    color: #ced4da;
}
.dead-badge {
    display: inline-block;
    background: #212529;
    color: #ff8787;
    font-size: 13px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    vertical-align: middle;
    margin-left: 6px;
    letter-spacing: -0.2px;
    border: 1px solid #495057;
}

/* ============================
   토큰 이미지 레이아웃
============================ */

/* 1. 리스트 뷰: 썸네일 우측 하단 뱃지형 토큰 (큼직하게 튀어나옴) */
.card-token-img {
    position: absolute;
    right: -70px;    /* 카드 오른쪽 밖으로 크게 튀어나옴 */
    bottom: -20px;   /* 카드 하단 밖으로 크게 튀어나옴 */
    width: 150px;    /* 이전보다 훨씬 큰 사이즈 */
    height: 150px;
    z-index: 30;
    pointer-events: none; 
}
.card-token-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom right;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3)); 
}

/* 2. 상세 뷰: 전신처럼 단독 섹션으로 띄운 토큰 */
.token-standalone-box {
    display: inline-block;
    position: relative;
}
.token-standalone-box img {
    max-width: 100%;
    max-height: 450px; /* 원하는 만큼 큼직하게 설정 */
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15));
    transition: transform 0.25s ease;
}
.token-standalone-box:hover img {
    transform: scale(1.03);
}

.scenario-bottom-box {
    position: relative;
}
.scenario-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 시나리오 날짜 뱃지 스타일 */
.sc-badge-date {
    font-family: monospace;
    font-size: 11.5px;
    background: #f1f3f5;
    color: #495057;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    font-weight: 700;
    flex-shrink: 0;
    margin-right: 10px;
}
.empty-list {
    color: #adb5bd;
}

/* ============================
   반응형
============================ */
@media (max-width: 768px) {
    .detail-top-row,
    .detail-mid-row,
    .form-row,
    .meta-flex {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    .head-photo-box {
        height: 280px;
    }
    .modal-nav-btn.prev { left: 10px; }
    .modal-nav-btn.next { right: 10px; }
    .file-row-flex {
        flex-direction: column;
        align-items: stretch;
    }
    .file-chip-card {
        flex-wrap: wrap;
    }
    .file-name-chip {
        max-width: 200px;
    }
    .stat-emblem-list {
        gap: 14px;
    }
    .stat-mini-cluster {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    .stat-detail-list {
        grid-template-columns: 1fr;
    }
    .scenario-row-item {
        flex-wrap: wrap;
    }
    .scenario-row-item .sc-date {
        width: 100%;
    }
    
    .card-token-img {
        width: 100px;
        height: 100px;
        right: -15px;
        bottom: -15px;
    }
    
    .bottom-flex-wrap {
        flex-direction: column;
    }
    .token-bottom-box {
        width: 100%;
    }
}