@charset "UTF-8";
/* ============================================================
   에테라 연대기 — 작품 페이지 표준 스타일 (work.css)  v2

   섹션 구조 (work.js 의 SECTION_ORDER 와 일치):
     home → info(작품 정보) → world(세계관·지도) → characters(인물) → prologue

   설계 기준: PC 우선. 모바일은 무너지지 않는 선까지 대응.
   편별로 달라지는 값은 각 index.html 의 <style> 블록에서
   아래 토큰만 덮어쓴다. 그 외에는 이 파일을 수정한다.
   ============================================================ */

:root {
    --text-color: #ddd;
    --accent-color: #b22222;
    --accent-rgb: 178, 34, 34;   /* --accent-color 의 R,G,B (rgba() 용) */
    --sub-accent: #555;
    --nav-bg: rgba(10, 10, 10, 0.85);
    --mobile-menu-bg: rgba(15, 15, 15, 0.98);
    --bg-dark: #050505;
    --title-color: #fff;         /* 섹션 제목 색 */

    --panel-bg: rgba(18, 18, 22, 0.88);
    --panel-line: rgba(255, 255, 255, 0.10);
    --work-bg: none;             /* #global-bg 배경 이미지 */
}

/* ---------- 기본 ---------- */
body, html { width: 100%; margin: 0; padding: 0; overflow-x: hidden; scroll-behavior: smooth; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #222; }
::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-color); }

body {
    font-family: 'Gowun Batang', 'Noto Serif KR', serif; color: var(--text-color); line-height: 1.6;
    background-color: var(--bg-dark);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease;
    opacity: 1; transform-origin: center center;
}
body.zoom-out { transform: scale(0.85); opacity: 0; filter: blur(2px); pointer-events: none; }
body.modal-open { overflow: hidden; }

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; padding: 0; margin: 0; }

#global-bg {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh; z-index: -10;
    background-image: var(--work-bg);
    background-size: cover; background-position: center; filter: brightness(0.4);
}
#global-bg::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.8));
}

/* ---------- 헤더 / 내비게이션 ---------- */
header {
    position: fixed; top: 0; width: 100%; padding: 1.2rem 5%; background: var(--nav-bg); z-index: 1000;
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); backdrop-filter: blur(5px); box-sizing: border-box;
}
.logo { z-index: 1001; cursor: pointer; display: flex; align-items: center; }
.logo-text { font-family: 'Cinzel', 'Noto Serif KR', serif; font-size: 1.35rem; font-weight: 700; color: #fff; letter-spacing: 1px; text-shadow: 0 0 12px rgba(0,0,0,0.9); transition: 0.3s; }
.logo:hover .logo-text { color: var(--accent-color); }
.logo-img { height: 35px; filter: brightness(0) invert(1); transition: 0.3s; }
.logo-img:hover { transform: scale(1.05); }

.header-controls { display: flex; align-items: center; gap: 2rem; z-index: 1002; }
/* min-width/height: 아이콘 폰트 로드 실패 시 버튼이 0x0 이 되는 것을 막는다 */
.bgm-toggle { font-size: 1.5rem; color: #fff; cursor: pointer; transition: 0.3s; z-index: 1003; background: none; border: none; padding: 0; line-height: 1; min-width: 30px; min-height: 30px; }
.bgm-toggle:hover { color: var(--accent-color); transform: scale(1.1); }
.desktop-nav ul { display: flex; gap: 2rem; }
.desktop-nav a { font-size: 1rem; font-weight: 700; color: #ccc; text-shadow: 0 0 5px rgba(0,0,0,0.8); }
.desktop-nav a:hover { color: var(--accent-color); }
.mobile-menu-btn { display: none; font-size: 1.8rem; color: #fff; cursor: pointer; z-index: 1003; background: none; border: none; padding: 0; line-height: 1; min-width: 34px; min-height: 34px; }

.mobile-nav-overlay {
    position: fixed; top: 0; right: -100%; width: 100%; height: 100vh;
    background: var(--mobile-menu-bg); display: flex; flex-direction: column;
    justify-content: center; align-items: center; transition: right 0.4s ease; z-index: 2000;
}
.mobile-nav-overlay.active { right: 0; }
.mobile-nav-overlay ul { display: flex; flex-direction: column; gap: 2.5rem; text-align: center; }
.mobile-nav-overlay a { font-size: 1.6rem; font-family: 'Noto Serif KR', serif; font-weight: 700; color: #ddd; }
.mobile-nav-close { position: absolute; top: 20px; right: 25px; font-size: 2rem; color: #fff; cursor: pointer; background: none; border: none; }

@media (max-width: 1024px) {
    .desktop-nav { display: none; }
    .mobile-menu-btn { display: block; }
}

/* ---------- 섹션 공통 ---------- */
section {
    padding: 5.5rem 5% 2rem; min-height: 100vh; display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    background: transparent; border-bottom: 1px solid rgba(255,255,255,0.05);
    width: 100%; position: relative; box-sizing: border-box;
}
.section-title { font-family: 'Noto Serif KR', serif; font-size: 2.8rem; margin: 0 0 0.7rem; color: var(--title-color); text-align: center; text-shadow: 0 0 15px rgba(255,255,255,0.3); }
.section-desc { text-align: center; max-width: 820px; margin: 0 auto 0.9rem; color: #bbb; text-shadow: 1px 1px 2px #000; font-size: 1.05rem; }
/* 제목과 내용 사이의 얇은 구분선 */
.section-rule {
    width: 100%; max-width: 420px; height: 1px; margin: 1.2rem auto 1.7rem;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.16) 20%, rgba(255,255,255,0.16) 80%, transparent);
}

.fade-in { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* 탭 (세계관 / 인물 공용) */
.tab-bar { display: flex; gap: 0.8rem; margin: 1.5rem 0 2.5rem; flex-wrap: wrap; justify-content: center; z-index: 10; }
.tab-btn {
    background: rgba(30,30,30,0.8); border: 1px solid rgba(255,255,255,0.2);
    font-family: 'Noto Serif KR', serif; font-size: 1.1rem; color: #aaa; cursor: pointer; transition: 0.3s;
    padding: 9px 22px; border-radius: 4px; font-weight: 700; display: flex; align-items: center; gap: 9px;
}
.tab-icon { height: 22px; width: 22px; object-fit: contain; filter: brightness(0) invert(1); transition: 0.3s; opacity: 0.7; }
.tab-btn:hover { background: rgba(55,55,55,1); color: #fff; border-color: #fff; }
.tab-btn:hover .tab-icon { opacity: 1; }
.tab-btn.active { background: rgba(var(--accent-rgb), 0.22); color: #fff; border-color: var(--accent-color); box-shadow: 0 0 15px rgba(var(--accent-rgb), 0.45); }
.tab-btn.active .tab-icon { opacity: 1; }

/* ---------- #home ---------- */
#home { text-align: center; }
.main-logo {
    width: 100%; max-width: 700px; height: auto; margin: 0 auto 2.5rem auto; display: block;
    filter: drop-shadow(0 0 15px rgba(255,255,255,0.3));
}
/* 로고 원본이 검정 선화일 때 흰색으로 반전 */
.main-logo.invert { filter: brightness(0) invert(1) drop-shadow(0 0 15px rgba(255,255,255,0.5)); }
.hero-sub-text { color: #fff; margin-bottom: 3.5rem; text-shadow: 0 2px 10px rgba(0,0,0,0.8); font-family: 'Gowun Batang', serif; font-size: 2rem; word-break: keep-all; }

.btn-group { display: flex; gap: 1.5rem; justify-content: center; margin-bottom: 2rem; flex-wrap: wrap; }
.btn {
    padding: 0.5rem 1.5rem; border: none; border-bottom: 2px solid #ccc; color: #eee; font-weight: bold;
    background: transparent; cursor: pointer; font-size: 1.1rem; transition: 0.3s;
    display: inline-flex; justify-content: center; align-items: center; font-family: 'Noto Serif KR', serif;
    text-shadow: 0 0 10px rgba(0,0,0,1);
}
.btn:hover { color: var(--accent-color); border-bottom-color: var(--accent-color); text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.8); }
.play-menu { position: relative; display: inline-block; }
.play-btn .caret { font-size: 0.8em; margin-left: 6px; opacity: 0.8; }
.play-options {
    position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(-6px);
    display: flex; flex-direction: column; min-width: 150px;
    background: rgba(12,12,16,0.97); border: 1px solid var(--panel-line); border-radius: 6px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.7); backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden; transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 60; overflow: hidden;
}
.play-menu.open .play-options { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.play-options a {
    padding: 12px 18px; color: #ddd; font-family: 'Noto Serif KR', serif; font-weight: 700; font-size: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06); transition: 0.2s;
}
.play-options a:last-child { border-bottom: none; }
.play-options a:hover { background: rgba(var(--accent-rgb), 0.25); color: #fff; }

.text-link-btn { display: inline-block; margin-top: 2rem; font-size: 1rem; color: #999; transition: 0.3s; cursor: pointer; font-weight: bold; }
.text-link-btn:hover { color: #fff; text-decoration: underline; }

/* ---------- #info (작품 정보) ---------- */
.info-layout {
    display: flex; flex-direction: column; align-items: center; gap: 2.2rem;
    width: 100%; max-width: 780px; margin-top: 0.5rem;
}
.info-intro {
    font-family: 'Gowun Batang', serif; font-size: 1.42rem; line-height: 1.95; color: #e4e4e4;
    word-break: keep-all; text-align: center; width: 100%;
}
.info-intro em { font-style: normal; color: var(--accent-color); font-weight: 700; }
.info-intro strong { color: #fff; font-weight: 700; }

.info-grid { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 470px; }
.info-item {
    background: var(--panel-bg); padding: 9px 14px; border-radius: 4px;
    border: 1px solid var(--panel-line); transition: 0.3s;
    display: flex; align-items: baseline; justify-content: center; gap: 12px;
}
.info-item:hover { border-color: var(--accent-color); }
.info-label { font-size: 0.78rem; color: #8b8b8b; margin: 0; flex: none; font-family: 'Noto Sans KR', sans-serif; }
.info-value { font-size: 1rem; color: #eee; font-weight: 700; font-family: 'Noto Serif KR', serif; }
.info-value.long { font-size: 0.92rem; line-height: 1.45; }
.info-value .gender { color: var(--accent-color); font-size: 0.88rem; margin: 0 2px 0 8px; }
.info-value .gender.first { margin-left: 0; }

/* ---------- #world (세계관) ---------- */
#world .tab-panel-wrap, #world2 .tab-panel-wrap { width: 100%; max-width: 1100px; }
.world-group { display: none; }
.world-group.active { display: block; }

/* 세계관: 제목 아래 대분류 탭까지의 거리를 좁힌다 */
#world .section-rule, #world2 .section-rule { margin-bottom: 1.5rem; }
#world > .tab-bar, #world2 > .tab-bar { margin: 0 0 1rem; gap: 1rem; }
#world > .tab-bar > .tab-btn, #world2 > .tab-bar > .tab-btn { font-size: 1.2rem; padding: 9px 28px; letter-spacing: 1px; }

/* 하위 탭은 밑줄형으로 — 대분류와 명확히 구분되게 */
.tab-bar.sub { margin: 0 0 2.5rem; gap: 1.6rem; }
/* 하위 탭이 없는 그룹(세계관 설정)은 대분류 탭과 내용 사이를 직접 벌린다 */
.world-group > .world-panel:first-child { padding-top: 2.5rem; }
.tab-btn.small {
    font-size: 1rem; padding: 5px 2px; background: transparent; border: none;
    border-bottom: 2px solid transparent; border-radius: 0; color: #888; font-weight: 500;
    box-shadow: none; letter-spacing: 0;
}
.tab-btn.small:hover { background: transparent; color: #ddd; border-color: rgba(255,255,255,0.25); }
.tab-btn.small.active { background: transparent; color: #fff; border-bottom-color: var(--accent-color); box-shadow: none; font-weight: 700; }
.tab-btn.small .tab-icon { height: 18px; width: 18px; }
.world-panel { display: none; }
.world-panel.active { display: block; animation: panelIn 0.45s ease; }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.world-head { display: flex; flex-direction: column; align-items: center; margin-bottom: 0.85rem; }
.world-emblem {
    width: 190px; height: 190px; object-fit: contain; margin-bottom: 1rem;
    filter: drop-shadow(0 0 18px rgba(255,255,255,0.55)) brightness(0) invert(1);
}
.world-name { font-family: 'Noto Serif KR', serif; font-size: 2.3rem; font-weight: 700; color: #fff; }
.world-lead { color: #bbb; font-size: 1.12rem; margin-top: 0.5rem; text-align: center; word-break: keep-all; max-width: 760px; }

.world-rows { display: flex; flex-direction: column; gap: 13px; width: 100%; max-width: 850px; margin: 0 auto; text-align: left; }
.world-row { display: flex; align-items: flex-start; gap: 15px; }
.world-row-label {
    background: rgba(var(--accent-rgb), 0.85); color: #fff; padding: 5px 14px; border-radius: 4px;
    font-weight: 700; font-size: 1rem; min-width: 62px; text-align: center;
    font-family: 'Noto Sans KR', sans-serif; white-space: nowrap; box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.world-row-desc { color: #ccc; font-size: 1.15rem; line-height: 1.65; word-break: keep-all; padding-top: 2px; font-family: 'Gowun Batang', serif; }

.world-body { max-width: 900px; margin: 0 auto; color: #ddd; font-size: 1.18rem; line-height: 1.95; word-break: keep-all; }
.world-body .w-cat { color: #fff; font-weight: 700; margin: 1.6rem 0 0.5rem; font-family: 'Noto Serif KR', serif; font-size: 1.15rem; border-bottom: 1px solid var(--panel-line); padding-bottom: 0.4rem; }
.world-body .w-cat:first-child { margin-top: 0; }
.world-body ul { padding-left: 16px; }
.world-body li { margin-bottom: 0.55rem; position: relative; }
.world-body li::before { content: '•'; color: var(--accent-color); position: absolute; left: -16px; font-weight: bold; }
.world-body .hl { color: var(--sub-accent); font-weight: 700; }

.world-map { width: 100%; text-align: center; }
.world-map img {
    width: 100%; max-width: 1000px; height: auto; border-radius: 12px;
    border: 2px solid var(--panel-line); box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

/* 주요 장소 — 이미지(좌) + 설명(우) */
/* 2열로 깔아 8곳이 한 화면에 들어오게 한다 */
.place-list {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
    width: 100%; max-width: 1100px; margin: 0 auto;
}
.place-row {
    display: grid; grid-template-columns: 145px 1fr; align-items: stretch;
    background: var(--panel-bg); border: 1px solid var(--panel-line);
    border-radius: 8px; overflow: hidden; transition: border-color 0.3s, transform 0.3s;
}
.place-row:hover { border-color: rgba(var(--accent-rgb), 0.55); transform: translateY(-2px); }
.place-row img { width: 100%; height: 100%; min-height: 80px; object-fit: cover; display: block; }
.place-text { padding: 0.6rem 0.9rem; display: flex; flex-direction: column; justify-content: center; }
.place-name { font-family: 'Noto Serif KR', serif; font-size: 1.08rem; font-weight: 700; color: #fff; margin-bottom: 0.22rem; }
.place-desc {
    color: #bcbcbc; font-size: 0.88rem; line-height: 1.5; word-break: keep-all;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* 설명이 필요 없는 장소 — 하단 미리보기 스트립 */
.place-strip-wrap { width: 100%; max-width: 1100px; margin: 1rem auto 0; }
.place-strip-title { color: #888; font-size: 0.84rem; font-family: 'Noto Sans KR', sans-serif; margin-bottom: 0.45rem; text-align: center; }
.place-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.place-strip::-webkit-scrollbar { height: 6px; }
.place-chip { position: relative; flex: none; width: 100px; aspect-ratio: 16 / 10; border-radius: 6px; overflow: hidden; border: 1px solid var(--panel-line); }
.place-chip img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5); transition: 0.35s; display: block; }
.place-chip:hover img { filter: brightness(0.9); transform: scale(1.06); }
.place-chip span {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 5px;
    font-size: 0.76rem; color: #fff; text-shadow: 0 1px 5px #000;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent); pointer-events: none;
}

/* 장소 확대 보기 */
.place-row, .place-chip { cursor: pointer; }
.place-lightbox {
    display: none; position: fixed; inset: 0; z-index: 3100;
    background: rgba(0,0,0,0.94); justify-content: center; align-items: center;
    padding: 4vh 5vw; box-sizing: border-box;
}
.place-lightbox.open { display: flex; animation: lbIn 0.25s ease; }
@keyframes lbIn { from { opacity: 0; } to { opacity: 1; } }
.pl-figure { margin: 0; max-width: 1200px; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.pl-figure img {
    max-width: 100%; max-height: 78vh; object-fit: contain; display: block;
    border-radius: 8px; border: 1px solid var(--panel-line); box-shadow: 0 20px 60px rgba(0,0,0,0.9);
}
.pl-figure figcaption { text-align: center; max-width: 760px; }
.pl-name { display: block; font-family: 'Noto Serif KR', serif; font-size: 1.5rem; font-weight: 700; color: #fff; }
.pl-desc { display: block; color: #bbb; font-size: 1rem; line-height: 1.65; margin-top: 0.5rem; word-break: keep-all; }
.pl-desc:empty { display: none; }
.place-lightbox .cd-nav { height: 84px; }

/* ---------- #characters (포스터 도감) ---------- */
.char-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 22px; width: 100%; max-width: 1200px;
}
.char-card {
    position: relative; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden;
    /* 인물 이미지가 배경 투명이므로 카드 자체를 위→아래 그라데이션으로 받친다 */
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 45%, rgba(0,0,0,0.88) 100%);
    border: 1px solid var(--panel-line); cursor: pointer;
    transition: transform 0.35s cubic-bezier(0.2,0.8,0.2,1), box-shadow 0.35s, border-color 0.3s;
    box-shadow: 0 10px 24px rgba(0,0,0,0.6);
}
.char-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease, filter 0.4s ease; filter: brightness(0.9) saturate(0.95); }
.char-card:hover { transform: translateY(-8px); border-color: var(--accent-color); box-shadow: 0 18px 36px rgba(0,0,0,0.75), 0 0 22px rgba(var(--accent-rgb), 0.4); }
.char-card:hover img { transform: scale(1.06); filter: brightness(1) saturate(1); }

.char-card-cap {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 25%, transparent);
    text-align: left; pointer-events: none;
}
.char-card-name { font-family: 'Noto Serif KR', serif; font-size: 1.2rem; font-weight: 700; color: #fff; text-shadow: 0 2px 8px #000; }
.char-card-role { font-size: 0.82rem; color: #bbb; margin-top: 2px; font-family: 'Noto Sans KR', sans-serif; }

/* 인물 상세 모달 */
.char-modal {
    display: none; position: fixed; inset: 0; z-index: 3000;
    background: rgba(0,0,0,0.93); justify-content: center; align-items: center; padding: 3vh 2vw; box-sizing: border-box;
}
.char-modal.open { display: flex; }
.char-detail {
    background: #0d0d10; width: 1080px; max-width: 100%; height: 100%; max-height: 94vh;
    border: 1px solid #2a2a2a; border-radius: 10px; box-shadow: 0 0 60px rgba(0,0,0,0.9);
    display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); overflow: hidden; position: relative;
}
.char-detail.zoom-in { animation: zoomIn 0.28s forwards cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.char-detail.zoom-out-modal { animation: zoomOut 0.2s forwards; }
@keyframes zoomIn  { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes zoomOut { from { transform: scale(1); opacity: 1; } to { transform: scale(0.9); opacity: 0; } }

.cd-visual { position: relative; background: #050505; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cd-visual img { width: 100%; height: 100%; object-fit: contain; }

.cd-info { padding: 2.2rem 2.2rem 1rem; display: flex; flex-direction: column; overflow-y: auto; }
.cd-name { font-family: 'Noto Serif KR', serif; font-size: 2.4rem; font-weight: 700; color: #fff; line-height: 1.2; }
.cd-line {
    font-size: 1rem; color: #ddd; margin: 0.9rem 0 1.3rem; font-family: 'Gowun Batang', serif;
    background: rgba(255,255,255,0.05); display: inline-block; padding: 8px 18px; border-radius: 4px;
    border-left: 4px solid var(--accent-color); font-weight: 700; align-self: flex-start;
}
.cd-line .sep { color: #666; margin: 0 10px; font-weight: normal; }
.cd-trait { font-family: 'Noto Sans KR', sans-serif; background: rgba(255,255,255,0.03); padding: 6px 16px 10px; border-radius: 8px; border: 1px solid var(--panel-line); }
.cd-row { display: flex; gap: 14px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.cd-row:last-child { border-bottom: none; }
.cd-key {
    flex: none; width: 42px; color: var(--accent-color); font-weight: 700; font-size: 0.88rem;
    letter-spacing: 1px; padding-top: 2px;
}
.cd-val { color: #ccc; font-size: 0.98rem; line-height: 1.7; word-break: keep-all; }

/* 이미지 세트 전환 (프론티아 / 크랙) */
/* margin-top:auto — 인용구 아래 남는 공간을 밀어내 썸네일 바로 위에 붙인다 */
.cd-source { display: flex; gap: 6px; margin-top: auto; padding-top: 16px; }
.cd-source:empty { padding: 0; }
.src-btn {
    background: transparent; border: 1px solid rgba(255,255,255,0.18); color: #888;
    font-family: 'Noto Sans KR', sans-serif; font-size: 0.75rem; padding: 4px 11px;
    border-radius: 20px; cursor: pointer; transition: 0.25s;
}
.src-btn:hover { color: #fff; border-color: #fff; }
.src-btn.active { background: rgba(var(--accent-rgb), 0.22); border-color: var(--accent-color); color: #fff; }
.cd-quote { font-size: 1.2rem; color: #eee; font-style: italic; font-family: 'Gowun Batang', serif; margin-top: 1.3rem; line-height: 1.6; border-top: 1px solid var(--panel-line); padding-top: 1.2rem; word-break: keep-all; }
.cd-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; }
.cd-thumbs::-webkit-scrollbar { height: 6px; }
.char-thumb { width: 58px; height: 84px; flex: none; object-fit: cover; opacity: 0.4; cursor: pointer; transition: 0.2s; border: 2px solid transparent; box-sizing: border-box; border-radius: 4px; }
.char-thumb:hover, .char-thumb.active { opacity: 1; border-color: var(--accent-color); }

/* 특별 이미지 — data.js 에 gallery.special 이 있는 편에만 생긴다 (기본은 표시 없음) */
.cd-spec { padding-top: 0.9rem; margin-top: 0.9rem; border-top: 1px solid var(--panel-line); }
.cd-spec-title { font-family: 'Noto Sans KR', sans-serif; font-size: 0.82rem; color: #888; margin-bottom: 0.45rem; letter-spacing: 0.04em; }
.cd-spec-row { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 6px; }
.cd-spec-row::-webkit-scrollbar { height: 6px; }
.char-thumb.spec { width: 76px; height: 107px; opacity: 0.62; border-radius: 6px; }

/* (2026-09-01 변경) 설명 · 특별 이미지 · 이미지 미리보기가 하나로 이어져 스크롤된다.
   예전에는 설명 텍스트(.cd-body)만 따로 스크롤시키고 이미지 줄을 아래에 고정했는데,
   이미지 줄이 셋 이상인 편에서는 오히려 아래쪽이 잘렸다.
   work.js 가 special 이 있는 편에만 .cd-split 을 붙이므로 다른 편은 영향 없음. */
.cd-info.cd-split { overflow-y: auto; }
.cd-info.cd-split .cd-body { display: flex; flex-direction: column; flex: none; }
.cd-info.cd-split .cd-source { margin-top: 0; }
.cd-info.cd-split .cd-spec,
.cd-info.cd-split .cd-thumbs,
.cd-info.cd-split .cd-hint,
.cd-info.cd-split #cdThumbsTitle { flex: none; }
.cd-info.cd-split #cdThumbsTitle { padding-top: 0.7rem; margin-bottom: 0; }
.cd-info.cd-split .cd-thumbs { padding-top: 6px; }

.cd-hint { font-size: 0.78rem; color: #666; font-family: 'Noto Sans KR', sans-serif; padding-bottom: 0.8rem; }

.close-char-modal {
    position: absolute; top: 14px; right: 14px; color: #fff; font-size: 26px; cursor: pointer; z-index: 3002;
    background: rgba(0,0,0,0.65); width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; transition: 0.3s; border: 1px solid #555;
}
.close-char-modal:hover { background: var(--accent-color); border-color: var(--accent-color); }
.cd-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3001;
    background: rgba(0,0,0,0.55); border: 1px solid #444; color: #fff;
    width: 44px; height: 64px; font-size: 1.6rem; cursor: pointer; transition: 0.3s;
    display: flex; align-items: center; justify-content: center; border-radius: 6px;
}
.cd-nav:hover { background: var(--accent-color); border-color: var(--accent-color); }
.cd-prev { left: 10px; } .cd-next { right: 10px; }

/* 인물 전환 애니메이션 — PC 에서만 적용 (모바일은 부하를 피한다) */
@media (min-width: 1025px) {
    .char-detail.slide-next .cd-visual { animation: slideInR 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
    .char-detail.slide-prev .cd-visual { animation: slideInL 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
    .char-detail.slide-next .cd-info,
    .char-detail.slide-prev .cd-info { animation: fadeUp 0.4s ease; }
}
@keyframes slideInR { from { opacity: 0; transform: translateX(38px); } to { opacity: 1; transform: none; } }
@keyframes slideInL { from { opacity: 0; transform: translateX(-38px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp   { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- #prologue ---------- */
#prologue { padding: 6rem 0; background: transparent; }
.prologue-wrapper { width: 100%; max-width: 700px; margin: 0 auto; text-align: center; position: relative; padding: 0 5%; box-sizing: border-box; }
.webtoon-viewer {
    /* min-height: 이미지 로드가 실패해도 뷰어가 0px 로 접혀
       '펼치기' 버튼이 눌리지 않게 되는 것을 막는다 */
    max-height: 400px; min-height: 400px; overflow: hidden;
    transition: max-height 1.5s cubic-bezier(0.25, 1, 0.5, 1);
    background: #111; margin-top: 20px; position: relative;
    border: 1px solid #333; border-radius: 8px; box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}
.webtoon-viewer.expanded { max-height: 50000px; }
.webtoon-viewer img { width: 100%; display: block; filter: brightness(0.9); }
.preview-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 250px;
    background: linear-gradient(to bottom, transparent 0%, rgba(10,10,10,0.8) 50%, rgba(10,10,10,1) 100%);
    display: flex; justify-content: center; align-items: flex-end; padding-bottom: 40px;
    transition: opacity 0.5s; z-index: 10; box-sizing: border-box;
}
.webtoon-viewer.expanded .preview-overlay { opacity: 0; pointer-events: none; }
.overlay-btn, .fold-btn {
    border: 2px solid #ccc; padding: 12px 35px; border-radius: 30px;
    font-size: 1.2rem; color: #ccc; cursor: pointer; transition: 0.3s;
    background: rgba(0,0,0,0.6); backdrop-filter: blur(5px);
    font-family: 'Noto Serif KR', serif; font-weight: bold;
}
.fold-btn { margin-top: 40px; }
.overlay-btn:hover, .fold-btn:hover { background: var(--accent-color); color: #fff; border-color: var(--accent-color); }

/* ---------- 푸터 ---------- */
footer { text-align: center; padding: 3rem; background: rgba(5,5,5,0.9); color: #777; font-size: 0.9rem; border-top: 1px solid rgba(255,255,255,0.05); font-family: 'Noto Sans KR', sans-serif; font-weight: 300; }

/* ============================================================
   반응형 — PC 우선. 아래는 무너지지 않게 하는 대응
   ============================================================ */
/* PC: 인물 그리드를 4열로 고정해 카드를 크게 */
@media (min-width: 1025px) {
    .char-grid { grid-template-columns: repeat(4, 1fr); max-width: 1120px; gap: 26px; }
}

@media (max-width: 1024px) {
    .info-intro { font-size: 1.14rem; }
    .place-row { grid-template-columns: 140px 1fr; }
    .char-detail { grid-template-columns: 1fr; grid-template-rows: minmax(0, 46%) minmax(0, 54%); }
    .cd-info { padding: 1.4rem 1.4rem 0.6rem; }
    .cd-name { font-size: 1.9rem; }
    .world-emblem { width: 150px; height: 150px; }
}

@media (max-width: 768px) {
    section { justify-content: flex-start; padding: 90px 5% 50px; }
    .section-title { font-size: 2rem; word-break: keep-all; }
    .section-desc { font-size: 0.95rem; margin-bottom: 1.6rem; }
    .btn { padding: 0.5rem 1.2rem; font-size: 0.95rem; }

    .main-logo { max-width: 88%; margin-bottom: 1.6rem; }
    .hero-sub-text { font-size: 1.4rem; margin-bottom: 2.2rem; }

    .tab-bar { gap: 0.5rem; margin: 1rem 0 1.6rem; }
    .tab-btn { font-size: 0.9rem; padding: 6px 12px; gap: 6px; }
    .tab-icon { height: 17px; width: 17px; }

    .info-intro { font-size: 1rem; line-height: 1.9; padding-left: 1.1rem; }

    .world-emblem { width: 110px; height: 110px; }
    .world-name { font-size: 1.5rem; }
    .world-lead { font-size: 0.95rem; }
    .world-rows { gap: 10px; }
    .world-row { flex-direction: column; gap: 4px; }
    .world-row-label { padding: 4px 10px; font-size: 0.88rem; min-width: auto; align-self: flex-start; }
    .world-row-desc { font-size: 1rem; }
    .world-body { font-size: 1rem; line-height: 1.8; }
    .world-name { font-size: 1.6rem; }
    .tab-bar.sub { margin: 0 0 2rem; gap: 1.1rem; }
    #world > .tab-bar > .tab-btn, #world2 > .tab-bar > .tab-btn { font-size: 0.95rem; padding: 7px 14px; }
    .info-intro { font-size: 1rem; line-height: 1.85; }
    .info-value { font-size: 0.95rem; }

    .char-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
    .char-card-name { font-size: 1rem; }
    .char-card-role { font-size: 0.72rem; }
    .char-card-cap { padding: 26px 9px 9px; }

    .section-rule { margin: 1rem auto 1.8rem; max-width: 260px; }
    .cd-key { width: 36px; font-size: 0.8rem; }
    .cd-val { font-size: 0.92rem; }
    /* 모바일: 1열 + 이미지와 글자를 하나로 겹친다 */
    .place-list { grid-template-columns: 1fr; gap: 10px; }
    .place-row { grid-template-columns: 1fr; position: relative; }
    .place-row img { min-height: 0; aspect-ratio: 16 / 9; filter: brightness(0.32); }
    .place-text {
        position: absolute; inset: 0; padding: 1rem 1.3rem;
        justify-content: center; text-shadow: 0 2px 8px rgba(0,0,0,0.95);
    }
    .place-name { font-size: 1.25rem; margin-bottom: 0.35rem; }
    .place-desc { font-size: 0.93rem; line-height: 1.6; color: #ddd; }
    .place-chip { width: 116px; }
    .pl-name { font-size: 1.15rem; }
    .pl-desc { font-size: 0.9rem; }
    .place-lightbox { padding: 2vh 3vw; }
    .place-lightbox .cd-nav { height: 56px; width: 32px; font-size: 1.1rem; }
    .place-strip-title { font-size: 0.85rem; }

    .char-modal { padding: 0; }
    .char-detail { max-height: 100vh; height: 100%; border-radius: 0; grid-template-rows: minmax(0, 42%) minmax(0, 58%); }
    .cd-name { font-size: 1.6rem; }
    .cd-line { font-size: 0.9rem; padding: 6px 12px; }
    .cd-trait { font-size: 0.95rem; padding: 12px; }
    .cd-quote { font-size: 1.05rem; margin-top: 1rem; padding-top: 0.9rem; }
    .cd-nav { width: 34px; height: 52px; font-size: 1.2rem; }
    .char-thumb { width: 46px; height: 66px; }
    .cd-spec { padding-top: 0.7rem; margin-top: 0.7rem; }
    .cd-spec-title { font-size: 0.76rem; margin-bottom: 0.35rem; }
    .char-thumb.spec { width: 62px; height: 88px; }
}
