:root {
  --bg: #0a0d14;
  --bg2: #10141d;
  --card: #141926;
  --card2: #1a2030;
  --line: #242b3b;
  --text: #eef1f7;
  --sub: #9aa3b5;
  --dim: #6b7486;
  --blue: #d94d87;
  --blue2: #f58db7;
  --green: #4ade80;
  --purple: #a974ff;
  --gold: #f5c451;
  --red: #ff6b6b;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #05070b; color: var(--text); font-family: Pretendard, -apple-system, 'Malgun Gothic', sans-serif; }
/* 한글은 기본이 글자 단위 줄바꿈이라 단어 중간에서 끊긴다. 단어 단위로, 칸보다 긴 단어만 쪼갠다 */
body { word-break: keep-all; overflow-wrap: anywhere; }
body { overscroll-behavior-y: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: var(--text); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; padding-bottom: 72px; }

/* 상단 */
#top { position: sticky; top: 0; z-index: 20; background: rgba(10, 13, 20, .96); backdrop-filter: blur(10px); }
.topbar { height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 6px; align-items: center; padding: 0 10px; }
.topbar .left, .topbar .right { min-width: 0; }
.topbar .left, .topbar .right { display: flex; gap: 8px; align-items: center; }
.topbar .right { justify-content: flex-end; }
.iconbtn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; position: relative; }
.iconbtn:active { background: var(--card); }
.dot { position: absolute; top: 5px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--blue); color: var(--blue2); border-radius: 999px; padding: 5px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill svg { width: 16px; height: 16px; }

.tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--bg2); }
.tabs a { flex: 1; text-align: center; padding: 11px 0 10px; color: var(--sub); font-size: 15px; position: relative; }
.tabs a.on { color: var(--blue2); font-weight: 700; }
.tabs a.on::after { content: ''; position: absolute; left: 25%; right: 25%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--blue); }

/* 하단 탭 */
#tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 64px; display: flex; background: rgba(12, 15, 23, .98); border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
#tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--sub); font-size: 11px; }
#tabbar a.on { color: var(--blue2); }
#tabbar a.on svg { fill: var(--blue); stroke: var(--blue); }

/* 섹션 */
.section { --gutter: 16px; padding: 20px var(--gutter) 8px; }
.section + .section { border-top: 6px solid #07090e; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; font-size: 21px; font-weight: 800; min-width: 0; word-break: keep-all; }
.sec-head h2 em { font-style: normal; color: var(--blue2); }
.sec-head .more { color: var(--sub); font-size: 13px; white-space: nowrap; flex: none; }
.sec-sub { color: var(--sub); font-size: 13px; margin: -8px 0 12px; }

.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(210px, 13em)), 1fr)); gap: 14px 12px; }
.rank-item { display: flex; gap: 10px; align-items: center; }
.cover { position: relative; flex: none; border-radius: 10px; overflow: hidden; background: linear-gradient(160deg, #1d2a4d, #0f1422 60%, #2a1740); }
.cover img { width: 100%; height: 100%; object-fit: contain; display: block; } /* 표지 전체를 보여 얼굴·상단이 잘리지 않게 한다. */
.cover .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; font-weight: 800; font-size: 12px; line-height: 1.3; color: #c9d4ff; }
.cover .num { position: absolute; top: 4px; left: 4px; min-width: 22px; height: 24px; border-radius: 5px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--blue); }
.cover .num.gray { background: #56607a; }
.rank-item .cover { width: 70px; height: 74px; }
.meta { min-width: 0; }
.meta .t { font-weight: 700; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta .g { color: var(--sub); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nums { display: flex; gap: 10px; font-size: 12px; margin-top: 4px; color: var(--sub); white-space: nowrap; }
.nums b { font-weight: 500; }
.nums .play::before { content: '▶ '; color: var(--blue); font-size: 10px; }
.nums .route { color: var(--green); }
.nums .route::before { content: '🌿'; font-size: 10px; margin-right: 2px; }

/* 가로로 넘겨 보는 줄: 스크롤바 없이 손가락으로 넘기고 카드 단위로 멈춘다. 페이지 자체는 가로로 흔들리지 않는다 */
.hscroll { display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-left: var(--gutter); margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex: none; scroll-snap-align: start; }
.poster { width: 124px; }
.poster .cover { width: 100%; aspect-ratio: 3 / 4; }
.poster .cover .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 8px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, .88) 45%); }
.poster .cap .t { font-size: 14px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poster .nums { color: #dfe4ee; margin-top: 4px; }
.hscroll > .branch-card { width: min(280px, 78vw); flex-wrap: nowrap; }
.hscroll > .branch-card .meta { flex: 1; }
.vlist { display: grid; gap: 10px; }

.branch-card { min-width: 0; display: flex; gap: 10px; background: var(--card); border-radius: 12px; padding: 10px; }
.branch-card .cover { width: 84px; height: 100px; }
.branch-card .big { color: var(--green); font-weight: 800; font-size: 17px; margin-top: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--blue); color: var(--blue2); margin-top: 6px; }

.list-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.list-item .cover { width: 64px; height: 84px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--card); color: var(--sub); font-size: 13px; }
.chip.on { background: var(--blue); color: #fff; font-weight: 700; }
.empty { color: var(--dim); text-align: center; padding: 40px 16px; font-size: 14px; line-height: 1.6; }
.cta-new { margin: 16px; display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius); background: linear-gradient(120deg, #17306b, #241a4b); border: 1px solid #2f4b93; }
.cta-new .plus { width: 42px; height: 42px; border-radius: 12px; background: var(--blue); display: grid; place-items: center; font-size: 26px; font-weight: 300; flex: none; }
.cta-new b { display: block; font-size: 16px; }
.cta-new span { color: #b9c5e6; font-size: 13px; }

/* 작품 상세 */
.detail-top { display: flex; gap: 14px; padding: 16px; }
.detail-top .cover { width: 150px; aspect-ratio: 832 / 1216; height: auto; align-self: flex-start; border-radius: 12px; } /* 표지 그림 비율 그대로(자르지 않음) */
.detail-top .cover[data-act] { cursor: zoom-in; }
.cover-zoom { padding: 16px; cursor: zoom-out; }
.cover-zoom img { display: block; max-width: min(100%, 640px); max-height: calc(100dvh - 32px); width: auto; height: auto; border-radius: 12px; margin: auto; }
.detail-top .badge { position: absolute; top: 8px; left: 8px; font-size: 11px; background: rgba(20, 30, 60, .9); border: 1px solid var(--blue); color: var(--blue2); padding: 2px 8px; border-radius: 6px; }
.detail-top h1 { font-size: 22px; line-height: 1.3; margin: 2px 0 6px; }
.detail-top .author { color: var(--sub); font-size: 14px; }
.stat-row { display: flex; gap: 0; margin-top: 12px; }
.stat-row > div { flex: 1; border-left: 1px solid var(--line); padding-left: 10px; }
.stat-row > div:first-child { border: 0; padding: 0; }
.stat-row b { display: block; font-size: 17px; }
.stat-row span { color: var(--sub); font-size: 11px; }
.graph-row { display: flex; gap: 14px; margin-top: 10px; color: var(--blue2); font-weight: 700; font-size: 16px; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.obtn { flex: 1; border: 1px solid var(--blue); color: var(--blue2); border-radius: 10px; padding: 8px 0; font-weight: 700; font-size: 14px; display: flex; gap: 4px; justify-content: center; align-items: center; }
.obtn.on { background: var(--blue); color: #fff; }
.obtn.gold { border-color: var(--gold); color: var(--gold); }
.obtn svg { width: 17px; height: 17px; }
.intro { margin: 0 16px; background: var(--card); border-radius: var(--radius); padding: 16px; }
.intro q { display: block; color: var(--blue2); font-size: 18px; font-weight: 700; margin-bottom: 10px; line-height: 1.4; }
.intro p { margin: 0; color: #cfd5e2; font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.intro .tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.intro .tags span { font-size: 12px; color: var(--sub); }
.box { margin: 14px 16px 0; background: var(--card); border-radius: var(--radius); padding: 14px; }
.box h3 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; gap: 6px; }
.route-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(92px, 6.5em)), 1fr)); gap: 10px 8px; }
.route-strip .step { min-width: 0; }
.route-strip .img { aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; background: linear-gradient(140deg, #1d2a4d, #2a1740); }
.route-strip .img img { width: 100%; height: 100%; object-fit: cover; }
.route-strip .n { font-size: 12px; margin-top: 5px; color: var(--sub); }
.route-strip .tt { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-strip .n::before { content: '→ '; color: var(--blue); }
.route-strip .step:first-child .n::before { content: ''; }
.two-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 16px 0; }
.two-box .box { margin: 0; }
.mini-route { font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mini-route:last-child { border: 0; }
.mini-route b { display: block; font-size: 14px; margin-bottom: 2px; }
.mini-route span { color: var(--sub); font-size: 12px; }
.badge-new { font-size: 10px; background: var(--blue); color: #fff; padding: 1px 6px; border-radius: 4px; margin-left: 4px; vertical-align: 2px; }
.badge-rare { font-size: 10px; background: #3a2461; color: #d6b8ff; padding: 1px 6px; border-radius: 4px; margin-left: 4px; vertical-align: 2px; }
.ep { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ep .no { width: 28px; height: 28px; border-radius: 6px; background: var(--card2); display: grid; place-items: center; font-size: 13px; color: var(--sub); flex: none; }
.ep .thumb { width: 92px; height: 52px; border-radius: 6px; overflow: hidden; flex: none; background: linear-gradient(140deg, #1d2a4d, #2a1740); }
.ep .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep .tt { font-weight: 700; font-size: 14px; }
.ep .pv { color: var(--sub); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep .v { margin-left: auto; color: var(--sub); font-size: 12px; white-space: nowrap; }
.bottom-cta { position: sticky; bottom: 64px; display: flex; gap: 8px; padding: 10px 16px; background: linear-gradient(transparent, var(--bg) 30%); z-index: 5; }
.bottom-cta > * { min-width: 0; }
.bottom-cta .ghost { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; display: flex; flex-direction: column; justify-content: center; border: 1px solid var(--blue); border-radius: 12px; padding: 8px; color: var(--blue2); text-align: center; line-height: 1.25; }
.bottom-cta .ghost small { display: block; color: var(--sub); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.primary { flex: 1.2; background: var(--blue); color: #fff; border-radius: 12px; padding: 12px 10px; font-weight: 800; font-size: 16px; text-align: center; display: flex; justify-content: center; align-items: center; gap: 6px; }
.primary:disabled { opacity: .5; }
.link-danger { color: var(--dim); font-size: 12px; text-decoration: underline; display: block; text-align: center; margin: 20px 0 8px; }

/* 리더 */
.reader-head { padding: 18px 22px 0; }
.reader-head h1 { font-size: 22px; margin: 0; font-weight: 800; line-height: 1.35; word-break: keep-all; }
.reader-head .pos { color: var(--sub); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
#top { transition: transform .2s; }
#top.hide { transform: translateY(-100%); }
#top .progress { height: 3px; background: var(--card2); overflow: hidden; }
#top .progress i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.body { padding: 14px 22px 30px; font-family: var(--ff, inherit); font-size: var(--fs, 17px); line-height: var(--lh, 1.85); color: #e3e7ef; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.body p { margin: 0 0 1em; }
.illust { margin: 0 16px 8px; border-radius: var(--radius); overflow: hidden; background: var(--card); position: relative; min-height: 180px; }
.illust img { width: 100%; display: block; }
.illust.locked img { filter: blur(18px) brightness(.6); transform: scale(1.1); }
.illust .lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 16px; }
.illust .lock p { margin: 0; color: #d6dcea; font-size: 14px; }
.illust .ill-rep { position: absolute; right: 8px; top: 8px; background: rgba(0, 0, 0, .5); color: #d6dcea; border: 0; border-radius: 999px; font-size: 12px; padding: 4px 10px; min-height: 28px; }
.illust .spent { position: absolute; left: 10px; bottom: 10px; background: rgba(0, 0, 0, .65); border-radius: 999px; font-size: 12px; padding: 4px 10px; color: #cdd8ff; }
.shimmer { height: 220px; display: grid; place-items: center; color: var(--sub); font-size: 13px; background: linear-gradient(100deg, var(--card) 30%, var(--card2) 50%, var(--card) 70%); background-size: 300% 100%; animation: sh 1.6s infinite linear; }
@keyframes sh { from { background-position: 100% 0 } to { background-position: 0 0 } }
.choose { padding: 18px 16px 30px; border-top: 1px solid var(--line); }
.choose h2 { margin: 0; font-size: 24px; font-weight: 800; word-break: keep-all; }
.choose h2 em { font-style: normal; color: var(--blue2); }
.choose .sub { color: var(--sub); font-size: 13px; margin: 4px 0 14px; }
.choose .head { display: flex; justify-content: space-between; align-items: flex-start; }
.choice { display: flex; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 12px 14px; margin-bottom: 10px; align-items: center; }
.choice:active { border-color: var(--blue); }
.choice.mine { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.choice .c { flex: 1; min-width: 0; }
.choice .ct { font-weight: 700; font-size: 16px; line-height: 1.35; }
.choice .ch { color: var(--sub); font-size: 13px; margin-top: 3px; line-height: 1.4; }
.choice .bar { height: 5px; background: var(--card2); border-radius: 5px; margin-top: 9px; overflow: hidden; }
.choice .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue2)); border-radius: 5px; }
.choice .cnt { color: var(--sub); font-size: 12px; margin-top: 5px; }
.choice .stat { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.choice .stat .bar { flex: 1; margin: 0; }
.choice .pct { font-size: 20px; font-weight: 800; color: var(--blue2); white-space: nowrap; flex: none; }
.choice .pct small { font-size: 14px; }
.bdg { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin: 0 4px 0 0; vertical-align: 2px; }
.bdg.popular { border: 1px solid var(--blue); color: var(--blue2); }
.bdg.rising { border: 1px solid #6b8cff; color: #9fb3ff; }
.bdg.rare { border: 1px solid var(--purple); color: #cfb0ff; }
.bdg.new { background: var(--blue); color: #fff; }
.bdg.unexplored { border: 1px solid #2f7a4d; color: var(--green); }
.free-btn { width: 100%; border: 1px solid var(--blue); border-radius: 14px; padding: 16px; color: var(--blue2); display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; }
.free-btn svg { width: 20px; height: 20px; }
.reader-foot { color: var(--dim); font-size: 12px; text-align: center; margin-top: 14px; }

/* 전환 */
#overlay { position: fixed; inset: 0; z-index: 60; display: none; background: rgba(5, 7, 12, .94); align-items: safe center; justify-content: center; overflow-y: auto; }
#overlay.on { display: flex; animation: fade .25s; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.trans { width: 100%; max-width: 420px; padding: 24px; text-align: center; }
.trans .picked { border: 1px solid var(--blue); box-shadow: 0 0 24px rgba(61, 123, 255, .35); border-radius: 16px; padding: 16px; font-size: 19px; font-weight: 800; margin-bottom: 22px; position: relative; }
.trans .picked small { position: absolute; top: -10px; left: 16px; background: var(--blue); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.trans .big { font-size: 40px; font-weight: 900; color: var(--blue2); }
.trans .desc { color: #c9d1e0; font-size: 15px; line-height: 1.6; }
.trans .rank { display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; padding: 6px 12px; border-radius: 999px; background: var(--card); color: var(--gold); font-size: 13px; font-weight: 700; }
.trans .discover { margin-top: 10px; font-size: 22px; font-weight: 800; }
.trans .discover + .desc { margin-top: 6px; }
.trans .founder { margin-top: 14px; background: var(--card); border-radius: 12px; padding: 10px; font-size: 13px; color: var(--sub); }
.trans .founder b { color: var(--blue2); }
.spinner { width: 34px; height: 34px; border: 3px solid var(--card2); border-top-color: var(--blue); border-radius: 50%; margin: 22px auto 10px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.trans .writing { color: var(--sub); font-size: 14px; }
/* 쓰는 중인 원고: 리더와 같은 글꼴, 왼쪽 정렬 */
.trans .live { margin-top: 20px; text-align: left; font-family: var(--ff); font-size: var(--fs); line-height: var(--lh); color: #dfe5f0; overflow-wrap: anywhere; }
.trans .live p { margin: 0 0 .9em; animation: fade .4s; }
.trans .live .live-note { color: var(--sub); font-size: 14px; text-align: center; font-family: inherit; }
.steps { text-align: left; display: inline-block; margin-top: 16px; color: var(--sub); font-size: 14px; line-height: 2; }
.steps .done { color: var(--green); }

/* 바텀시트 */
.sheet-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 70; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: 100%; max-width: 480px; background: #111624; border-radius: 22px 22px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .5 } to { transform: none; opacity: 1 } }
.sheet .grip { width: 40px; height: 4px; border-radius: 4px; background: #39415a; margin: 0 auto 10px; }
.sheet h3 { text-align: center; font-size: 21px; margin: 10px 0 6px; }
.sheet h3 em { font-style: normal; color: var(--blue2); }
.sheet .desc { text-align: center; color: #c9d1e0; font-size: 14px; line-height: 1.6; }
.sheet .desc b { color: var(--blue2); }
.pkg { display: flex; align-items: center; gap: 12px; width: 100%; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 14px; margin-top: 10px; text-align: left; }
.pkg.on { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue) inset; }
.pkg .ic { font-size: 26px; }
.pkg b { font-size: 16px; }
.pkg small { display: block; color: var(--sub); font-size: 12px; margin-top: 2px; }
.pkg .price { margin-left: auto; font-weight: 800; font-size: 17px; }
.sheet .row2 { display: flex; gap: 8px; margin-top: 10px; }
.sheet .row2 button { flex: 1; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px; line-height: 1.3; }
.sheet .row2 small { display: block; color: var(--sub); font-size: 11px; }
.sheet .mock { color: var(--dim); font-size: 11px; text-align: center; margin-top: 10px; }
.sheet textarea, .field textarea, .field input, .field select { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 15px; resize: none; outline: none; }
.sheet textarea:focus, .field textarea:focus, .field input:focus { border-color: var(--blue); }
.preview-card { display: flex; gap: 10px; background: var(--card); border-radius: 12px; overflow: hidden; margin-top: 14px; }
.preview-card img { width: 55%; object-fit: cover; filter: blur(8px) brightness(.7); }
.preview-card div { padding: 12px 12px 12px 0; font-size: 13px; color: #cfd5e2; line-height: 1.5; }

/* 새 작품 */
.new-wrap { padding: 20px 16px 30px; }
.new-wrap h1 { font-size: 24px; margin: 0 0 4px; }
.new-wrap .lead { color: var(--sub); margin: 0 0 16px; font-size: 14px; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 13px; color: var(--sub); margin-bottom: 6px; }
.attach { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--blue2); font-size: 14px; }
.attach .file { color: var(--text); background: var(--card); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
details.more-set { margin-top: 12px; background: var(--card); border-radius: 12px; padding: 12px 14px; }
details.more-set summary { cursor: pointer; color: var(--sub); font-size: 14px; }
.radio-row { display: flex; gap: 16px; margin-top: 8px; font-size: 15px; }
.radio-row label { display: flex; gap: 6px; align-items: center; color: var(--text); font-size: 15px; margin: 0; }
.notice { margin-top: 12px; background: #1b1830; border: 1px solid #3a2d63; border-radius: 12px; padding: 12px; color: #cdbef5; font-size: 13px; line-height: 1.6; }
.notice label { display: flex; gap: 8px; align-items: flex-start; color: #e6ddff; margin-top: 8px; font-size: 13px; }

/* MY */
.my-card { margin: 16px; background: var(--card); border-radius: var(--radius); padding: 16px; }
.my-card .nick { font-size: 20px; font-weight: 800; }
.coupon-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--card2); }
.coupon-row b { color: var(--blue2); font-size: 20px; }
.switch { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.switch input { width: 44px; height: 24px; accent-color: var(--blue); }
.switch small { display: block; color: var(--sub); font-size: 12px; }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #242c40; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 90; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90%; text-align: center; }
#toast.on { opacity: 1; }
.err { color: var(--red); font-size: 13px; margin-top: 8px; }
.radio-row input, .notice input { width: auto; }

/* 좁은 폰: 쿠폰 알약은 숫자만, 랭킹은 한 줄 */
.pill .lbl { display: inline; }
@media (max-width: 400px) {
  .pill .lbl { display: none; }
  .section { --gutter: 14px; }
}
@media (max-width: 359px) {
  .detail-top { flex-direction: column; }
  .detail-top .cover { width: 60%; height: auto; align-self: center; }
  .two-box { grid-template-columns: minmax(0, 1fr); }
}
.meta .g { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nums { flex-wrap: wrap; row-gap: 0; }

/* 상단바: 로고 칸이 좁으면 로고 이미지가 줄어든다 */
.topbar { grid-template-columns: auto minmax(0, 1fr) auto; }
.topbar .mid { min-width: 0; display: flex; justify-content: center; }
.logo { display: block; min-width: 0; max-width: 100%; }
.logo img { display: block; height: 30px; width: auto; max-width: 100%; object-fit: contain; }
.topbar .left, .topbar .right { flex: none; }
.topbar .left { min-width: 34px; }

/* 가로 모드처럼 화면 높이가 낮으면 하단 버튼을 고정하지 않는다 */
@media (max-height: 500px) {
  .bottom-cta { position: static; }
}

/* 줄 안의 글자 칸이 너무 좁아지면(큰 글꼴) 다음 줄로 내려간다 */
.ep { flex-wrap: wrap; }
.ep .epm { flex: 1 1 9em; min-width: 0; }
.list-item, .branch-card { flex-wrap: wrap; }
.list-item .meta, .branch-card .meta { flex: 1 1 8em; min-width: 0; }
.rank-item .meta { flex: 1; min-width: 0; }

.field select { width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 15px; color: var(--text); }
.intro q { quotes: none; }

/* 본문 사이에 들어간 삽화: 본문 여백만큼 바깥으로 넓혀 화면 폭에 맞춘다 */
.body > #ill { white-space: normal; margin: 1.4em -6px; }
.body > #ill .illust { margin: 0; min-height: 0; }
.body > #ill .shimmer { height: auto; } /* 비워 둔 자리를 삽화 비율 그대로(그림이 와도 글이 밀리지 않게) */
.illust img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 어떤 요소가 넘쳐도 페이지가 가로로 흔들리지 않게 */
#app { overflow-x: clip; }

/* 아이콘·알약 버튼 글자(Aa, 쿠폰 수)는 쪼개지 않는다 */
.iconbtn, .pill { white-space: nowrap; overflow-wrap: normal; }

.cover .r19 { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }
.agree { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: 13px; color: var(--sub); }
.agree input { width: 18px; height: 18px; flex: none; margin: 1px 0 0; accent-color: var(--blue); }
.agree a { color: var(--blue2); text-decoration: underline; }

/* 작품 상세 탭: 작품소개 | 회차 | 내 경로 | 삽화 */
.dtabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); margin-top: 4px; position: sticky; top: 56px; z-index: 6; background: var(--bg); }
.dtabs button { padding: 12px 2px 11px; color: var(--sub); font-size: 15px; position: relative; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dtabs button.on { color: var(--text); font-weight: 800; }
.dtabs button.on::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 3px; border-radius: 3px; background: var(--blue); }
#dpane { padding-bottom: 8px; }
#dpane > .intro { margin-top: 14px; }
.eps-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.eps-head h3 { margin: 0; }
.fk { color: var(--green); font-size: 13px; font-weight: 700; white-space: nowrap; }
.route-bar { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--card2); border-radius: 10px; padding: 10px 12px; margin-bottom: 6px; text-align: left; font-size: 14px; }
.route-bar b { flex: none; }
.route-bar span { flex: 1; min-width: 0; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-bar i { font-style: normal; color: var(--sub); flex: none; }
.ep .epa { display: flex; gap: 10px; align-items: center; flex: 1 1 14em; min-width: 0; flex-wrap: wrap; }
.ep .no { width: auto; min-width: 34px; padding: 0 4px; background: none; font-size: 13px; }
.ep.fork { background: rgba(61, 123, 255, .08); margin: 0 -14px; padding: 8px 14px; }
.ep.fork .no { color: var(--blue2); font-weight: 800; }
.ep .picked-by { color: var(--blue2); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep .mk { margin-left: auto; color: var(--sub); font-size: 14px; flex: none; padding: 0 4px; }
.ep .mk.now { color: var(--blue2); }
.ep .fbtn { margin-left: auto; flex: none; color: var(--green); font-weight: 800; font-size: 14px; border: 1px solid #2f7a4d; border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.ropt { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 8px; }
.ropt .rd { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--dim); flex: none; }
.ropt.on { border-color: var(--blue); background: rgba(61, 123, 255, .1); }
.ropt.on .rd { border-color: var(--blue); background: radial-gradient(var(--blue) 45%, transparent 50%); }
.ropt div { min-width: 0; }
.ropt small { display: block; color: var(--sub); font-size: 12px; margin-top: 2px; }
.rsep { color: var(--sub); font-size: 12px; margin: 16px 0 0; }

/* 내 경로: 가지 모양(들여쓰기와 왼쪽 선, 가로로 넓어지지 않는다) */
.tree { font-size: 14px; }
.tnode { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.tnode::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--card2); border: 2px solid var(--blue); flex: none; }
.tnode.root::before { border-color: var(--dim); }
.tnode.root + .tnode, .tnode.root + .tleaf { margin-top: 0; }
.tkids { margin-left: 5px; padding-left: 14px; border-left: 2px solid var(--line); display: grid; gap: 8px; padding-top: 4px; }
.tkid { min-width: 0; }
.tvia { color: var(--blue2); font-size: 12px; font-weight: 700; padding: 2px 0; }
.tleaf { background: var(--card2); border-radius: 10px; padding: 10px 12px; }
.tleaf.cur { border: 1px solid var(--blue); background: rgba(61, 123, 255, .12); }
.tleaf b { display: block; }
.tleaf small { color: var(--sub); font-size: 12px; }
.rcard { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rcard:last-child { border: 0; }
.rcard .thumb { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; flex: none; background: linear-gradient(140deg, #1d2a4d, #2a1740); }
.rcard .thumb img { width: 100%; height: 100%; object-fit: cover; }
.rcard .rm { flex: 1 1 9em; min-width: 0; }
.rcard .rt { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rcard small { display: block; color: var(--sub); font-size: 12px; margin-top: 2px; }
.rcard .ra { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

/* 삽화 탭 */
.art-head { margin: 14px 16px 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; background: linear-gradient(120deg, #17306b, #1a2030); border-radius: var(--radius); padding: 16px; flex-wrap: wrap; }
.art-head small { display: block; color: #b9c5e6; font-size: 12px; }
.art-head b { font-size: 30px; font-weight: 900; }
.art-head b span { font-size: 15px; margin-left: 2px; }
.art-head .r { text-align: right; }
.art-head .r b { color: var(--blue2); font-size: 22px; }
.agrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(30%, 140px), 1fr)); gap: 4px; margin: 12px 16px 0; }
.atile { aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--card2); position: relative; display: block; }
.atile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.atile.lk img { filter: blur(10px) brightness(.5); transform: scale(1.15); }
.atile.lk span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; }

/* 리더: 하단 탭 바로 위에 고정한 이동 바(이전 화 · 목록 · 내가 이어 읽은 다음 화). 숨을 땐 탭 뒤로 내려간다 */
.ep-nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: 64px; width: 100%; max-width: 480px; z-index: 25; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px 12px; background: rgba(12, 15, 23, .97); border-top: 1px solid var(--line); transition: transform .2s; }
.ep-nav > * { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 9px 6px; text-align: center; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-nav .off { color: var(--dim); background: none; }
.reading .choose { padding-bottom: 64px; }
.reading #toast { bottom: 140px; }
/* 읽으며 아래로 내리면 상단처럼 숨었다가, 올리거나 끝에 닿으면 다시 */
.ep-nav.hide { transform: translate(-50%, 110%); }

/* 내가 연(무료·구매) 삽화가 아니면 회차 썸네일도 흐리게 */
.thumb.lk img { filter: blur(6px) brightness(.55); transform: scale(1.15); }

/* 리더: 이 화 다시 쓰기(접힘) */
.rewrite { margin: 0 16px 12px; background: var(--card); border-radius: 12px; padding: 0 14px; }
.rewrite summary { cursor: pointer; padding: 12px 0; color: var(--sub); font-size: 14px; list-style: none; }
.rewrite summary::-webkit-details-marker { display: none; }
.rewrite summary::after { content: ' ▾'; }
.rewrite[open] summary::after { content: ' ▴'; }
.rewrite[open] { padding-bottom: 12px; }
.rewrite textarea { width: 100%; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 14px; resize: none; outline: none; }
.rw-vers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rw-note { color: var(--dim); font-size: 12px; margin: 6px 0 0; }

/* 새 이야기: 원고로 만들기는 별도 카드 */
.or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; margin: 26px 0 14px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.src-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.src-card h2 { margin: 0 0 6px; font-size: 17px; }
.src-card .lead { margin: 0 0 12px; }
.src-card .lead b { color: var(--text); }
.file-btn { width: 100%; padding: 11px 0; cursor: pointer; }
.src-card .file { margin-top: 10px; color: var(--text); background: var(--card2); border-radius: 8px; padding: 8px 10px; font-size: 13px; }

/* 19+ 화 표시(성인 표시를 켠 사람에게만 보이는 화) */
.r19i { display: inline-grid; place-items: center; width: 1.35em; height: 1.35em; border-radius: 50%; background: #e5484d; color: #fff; font-size: .62em; font-weight: 800; margin-right: 6px; vertical-align: .2em; }

/* 회차 탭 맨 위 작품소개: 3줄로 접힘 */
.intro.fold { margin-top: 14px; }
.intro.fold p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.intro.fold:not(.open) .tags { display: none; }
.intro.fold.open p { display: block; }
.intro .more-btn { margin-top: 8px; color: var(--sub); font-size: 13px; }
.dtabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
a.rcard { color: inherit; }

/* 내 분기 그래프: 위→아래, 갈래마다 세로선(가로 스크롤 없음) */
.graph { display: grid; }
.grow { display: flex; gap: 10px; align-items: stretch; color: inherit; text-decoration: none; min-width: 0; }
.glanes { position: relative; flex: none; }
.gl { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #3a4560; }
.gl.top { bottom: auto; height: 15px; }
.gl.bot { top: 15px; }
.gh { position: absolute; top: 14px; height: 2px; background: #3a4560; border-radius: 0 2px 0 0; }
.gd { position: absolute; top: 10px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--card); border: 2px solid var(--dim); box-sizing: border-box; }
.gd.new { border-color: var(--green); }
.gd.cur { background: var(--blue); border-color: var(--blue2); }
.gtx { flex: 1; min-width: 0; padding: 6px 0 12px; font-size: 14px; line-height: 1.4; word-break: keep-all; overflow-wrap: anywhere; }
.gtx > b { display: block; font-weight: 600; }
.gvia { color: var(--blue2); font-size: 12px; font-weight: 700; margin-bottom: 1px; }
.gskip { display: block; color: var(--dim); font-size: 11px; }
.gtags { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 3px; }
.gt { color: var(--sub); font-size: 12px; }
.gt.now { color: var(--blue2); font-weight: 700; }
.gt.new { color: var(--green); }
.gmore, .ghint { color: var(--dim); font-size: 12px; margin-top: 8px; line-height: 1.5; }

[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue2); outline-offset: 4px; }

.home-intro h1 { font-size: 27px; line-height: 1.35; margin: 10px 0; }
.home-intro small,.eyebrow { color: var(--blue2); font-size: 13px; }
.home-intro p { color: var(--sub); font-size:14px; line-height:1.7; }
.world-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 12px; }
.world-card { min-width:0; }
.world-card .cover { width:100%; aspect-ratio:832/1216; }
.world-card b { display:block; margin-top:8px; font-size:15px; }
.world-card small { display:block; color:var(--sub); margin-top:4px; font-size:11px; }
.world-card p { margin:6px 0; font-size:12px; color:var(--sub); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.world-card .nums { flex-wrap:wrap; white-space:normal; gap:4px 8px; }
.continue-card { display:flex; gap:14px; background:linear-gradient(120deg,#261925,#191a26); padding:14px; border:1px solid #493344; border-radius:14px; }
.continue-card .cover { width:88px; height:114px; }
.continue-card .meta { flex:1; display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.continue-card small { color:var(--blue2); }
.continue-card b { font-size:16px; }
.continue-card span { color:var(--sub); font-size:12px; }
.continue-card strong { display:inline-flex; gap:5px; align-items:center; border-radius:8px; padding:5px 13px; background:var(--blue); font-size:13px; margin-top:auto; }
.continue-card svg { width:14px; height:14px; }
.route-card { display:flex; gap:12px; padding:14px; border:1px solid var(--line); border-radius:13px; background:var(--card); margin-bottom:12px; }
.route-card .cover { width:75px; height:95px; }
.route-card .meta { flex:1; }
.route-card small,.route-card span { display:block; color:var(--sub); font-size:12px; }
.route-card b { display:block; margin:4px 0; font-size:16px; }
.route-card p { font-size:12px; color:#cbd1df; margin:6px 0; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.route-flow { display:flex; flex-wrap:wrap; gap:7px; margin:16px 0 24px; font-size:13px; }
.route-flow span { padding:6px 10px; border:1px solid var(--line); border-radius:9px; }
.route-flow i { font-style:normal; color:var(--blue2); align-self:center; }
.detail-top .cover { width:min(34vw,140px); }
.graph-row { flex-wrap:wrap; gap:6px 12px; font-size:14px; }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms !important; transition-duration:.01ms !important; } }

/* 화면 이동 중(2026-10-02): 옛 화면을 흐리게 두고 위에 진행 줄. 0.15초 안에 끝나면 아무것도 안 보인다 */
#app.busy #view { opacity: .55; transition: opacity .15s .15s; pointer-events: none; }
#app.busy #top::after { content: ''; position: absolute; left: 0; bottom: 0; height: 2px; width: 40%; background: var(--blue); animation: busybar 1s .15s infinite ease-in-out; opacity: 0; }
@keyframes busybar { 0% { left: -40%; opacity: 1; } 100% { left: 100%; opacity: 1; } }
.skel { padding: 20px 16px; display: grid; gap: 16px; }
.skel-row { display: flex; gap: 12px; }
.skel-row i { width: 70px; height: 94px; border-radius: 10px; flex: none; }
.skel-row div { flex: 1; display: grid; gap: 8px; align-content: start; padding-top: 4px; }
.skel-row b { height: 12px; border-radius: 6px; }
.skel-row b:nth-child(1) { width: 70%; height: 15px; } .skel-row b:nth-child(2) { width: 45%; } .skel-row b:nth-child(3) { width: 60%; }
.skel-row i, .skel-row b { display: block; background: linear-gradient(100deg, var(--card) 30%, var(--card2) 50%, var(--card) 70%); background-size: 300% 100%; animation: sh 1.6s infinite linear; }
.route-note { padding: 14px 16px 0; margin: 0; }

/* 커뮤니티(2026-10-02) */
.post-card { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.post-card .cover { width: 56px; height: 72px; border-radius: 8px; }
.post-card .meta { flex: 1; min-width: 0; display: grid; gap: 4px; }
.post-card .pt { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.post-card .pt b { font-size: 15px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card small { color: var(--sub); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-card .pn { display: flex; gap: 12px; color: var(--sub); font-size: 12px; }
.cat { flex: none; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--sub); white-space: nowrap; }
.cat-question { border-color: var(--blue); color: var(--blue2); }
.cat-share { border-color: var(--green); color: var(--green); }
.cat-debate { border-color: var(--purple); color: var(--purple); }
.post h1 { font-size: 21px; line-height: 1.35; margin: 10px 0 6px; }
.post .by { color: var(--sub); font-size: 12px; }
.post-body { white-space: pre-wrap; line-height: 1.75; font-size: 15px; margin: 16px 0; }
.post-work { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--card); margin-bottom: 12px; }
.post-work img { width: 40px; height: 54px; object-fit: cover; border-radius: 6px; }
.post-work span { flex: 1; min-width: 0; display: grid; }
.post-work small { color: var(--sub); font-size: 11px; }
.post-work i { color: var(--sub); font-style: normal; }
.post-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-h { font-size: 16px; margin: 0 0 8px; }
.cmt { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cmt small { color: var(--sub); font-size: 12px; }
.cmt p { margin: 4px 0; white-space: pre-wrap; line-height: 1.6; font-size: 14px; }
.cmt-acts button { color: var(--dim); font-size: 12px; }
.cm-form { display: flex; gap: 8px; margin-top: 12px; align-items: stretch; }
.cm-form textarea { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: 14px; resize: none; }
.cm-form .primary { flex: none; padding: 0 16px; font-size: 14px; }
label.chip { cursor: pointer; }
/* 필터 칩은 한 줄로 두고 손가락으로 넘긴다(스크롤바 숨김, 2026-10-02 — 장르가 많으면 화면 절반을 덮었다) */
.chips { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chips > * { flex: none; }
.route-card small.rk { color: var(--blue2); font-weight: 700; }
.route-card small.rk-canon { color: var(--gold); }
.route-card small.rk-branch { color: var(--green); }

/* 홈(2026-10-02, 참고 그림 01) */
.wposter { width: 112px; display: grid; gap: 3px; align-content: start; }
.wposter .cover { width: 100%; aspect-ratio: 832 / 1216; border-radius: 10px; }
.wposter b { font-size: 14px; line-height: 1.3; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wposter small { color: var(--sub); font-size: 11px; }
.wposter .nums { margin-top: 0; gap: 8px; font-size: 11px; }
.rank-route { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--card); }
.rank-route .rn { width: 18px; flex: none; text-align: center; font-weight: 800; color: var(--blue2); }
.rank-route .cover { width: 48px; height: 64px; border-radius: 8px; }
.rank-route .meta { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rank-route b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-route small { color: var(--sub); font-size: 11px; }
.rank-route p { margin: 0; font-size: 12px; color: #cbd1df; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-route em { font-style: normal; color: var(--red); font-size: 12px; font-weight: 700; flex: none; }
.chips.flush { padding: 0; }
.section .sec-head h2 { font-size: 19px; }
.cta-new { margin: 8px 16px 20px; padding: 12px 14px; }
.continue-card .cover { width: 72px; height: 96px; }

/* 프로필 서랍(2026-10-02, 참고 그림 10) */
.sheet-bg.drawer-bg { justify-content: flex-end; align-items: stretch; }
.sheet.drawer { width: min(320px, 86vw); max-width: none; max-height: none; height: 100%; border-radius: 18px 0 0 18px; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: slidein .22s ease-out; }
.sheet.drawer .grip { display: none; }
@keyframes slidein { from { transform: translateX(100%); } to { transform: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dhead { display: flex; gap: 12px; align-items: center; margin: 6px 0 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 20px; background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; flex: none; }
.dhead b { display: block; font-size: 17px; }
.dhead small { color: var(--sub); font-size: 12px; word-break: break-all; }
.dstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; }
.dstats b { display: block; font-size: 18px; }
.dstats small { color: var(--sub); font-size: 11px; }
.dmenu { display: grid; padding: 6px 0; border-bottom: 1px solid var(--line); }
.dm { display: flex; align-items: center; gap: 12px; padding: 11px 2px; font-size: 15px; }
.dm svg { width: 20px; height: 20px; color: var(--sub); flex: none; }
.dm span { flex: 1; min-width: 0; display: grid; }
.dm small { color: var(--dim); font-size: 11px; }
.dm i { color: var(--dim); font-style: normal; }
/* 목록 머리 한 줄(2026-10-02): 큰 제목 대신 설명 + 만들기 */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 0; }
.list-head p { margin: 0; color: var(--sub); font-size: 13px; min-width: 0; }
.list-head .pill { padding: 4px 10px; font-size: 12px; }
.list-head + .chips { padding-top: 10px; }
/* 세계관 상세 위쪽(2026-10-02, 참고 그림 03): 표지를 흐리게 깐 배경. 표지 자체는 자르지 않고 그대로 */
.detail-top { position: relative; overflow: hidden; }
.detail-top > :not(.hero-bg) { position: relative; z-index: 1; }
.hero-bg { position: absolute; inset: -30px; background-size: cover; background-position: center 20%; filter: blur(22px) brightness(.45) saturate(1.2); z-index: 0; }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 40%, var(--bg)); }
/* 검색 도움(2026-10-02) */
.search-hint { padding: 0 16px; }
.hint-head { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 8px; }
.hint-head b { font-size: 15px; }
.hint-head button { color: var(--dim); font-size: 12px; }

/* 분기 고르기(2026-10-02): 고른 선택지 번호 · 입력창 · 진행 */
.choice { position: relative; }
.choice.picked { border-color: var(--blue); background: rgba(217, 77, 135, .08); }
.choice .cno { flex: none; align-self: flex-start; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 1px solid var(--line); color: var(--sub); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.choice.picked .cno { background: var(--blue); border-color: var(--blue); color: #fff; }
.ced { position: relative; min-height: 48px; font-size: 15px; line-height: 1.9; color: var(--text); outline: none; white-space: pre-wrap; word-break: break-word; }
/* 비어 있을 때 칸 바탕에 옅게 깔리는 글(10-05 사용자) — 글을 쓰거나 번호가 들어가면 사라진다 */
.ced { min-height: 56px; }
.ced.empty { padding: 0; text-align: left; color: var(--text); font-size: 15px; line-height: 1.9; } /* 빈 화면용 .empty(여백 40px)가 같은 이름이라 입력칸이 비면 커졌다 */
.ced.empty::before { content: '✎  ' attr(data-ph); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; color: var(--text); opacity: .22; font-size: 18px; font-weight: 600; letter-spacing: -.01em; pointer-events: none; }
.pick { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 9px; margin: 0 3px; vertical-align: 0; border-radius: 7px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 800; line-height: 1; cursor: pointer; user-select: none; -webkit-user-select: none; }
.pick i { font-style: normal; font-weight: 400; opacity: .8; }
.composer { margin-top: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.composer textarea { width: 100%; background: transparent; border: 0; outline: none; resize: vertical; font-size: 15px; line-height: 1.6; color: var(--text); min-height: 48px; }
.comp-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.comp-row small { flex: 1; color: var(--sub); font-size: 12px; }
.comp-row small.warn { color: var(--gold); }
.comp-row .primary { flex: none; padding: 10px 22px; font-size: 15px; }

/* 선택지 접기(2026-10-03): 앞 3개 밖은 접고, 펼치면 10개까지 세로 · 그 뒤는 가로로 넘김(스크롤바 숨김) */
.more-choices { margin: 2px 0 10px; }
.more-choices > summary { list-style: none; cursor: pointer; text-align: center; color: var(--sub); font-size: 14px; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; margin-bottom: 10px; }
.more-choices > summary::-webkit-details-marker { display: none; }
.more-choices > summary::after { content: ' ▾'; }
.more-choices[open] > summary::after { content: ' ▴'; }
.more-choices .swipe-note { color: var(--sub); font-size: 12px; margin: 4px 0 6px; }
.choice-swipe { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.choice-swipe::-webkit-scrollbar { display: none; }
.choice-swipe .choice { flex: 0 0 82%; scroll-snap-align: start; margin-bottom: 0; }
.ep-sep { margin: 10px 0 2px; padding: 4px 0; color: var(--sub); font-size: 12px; text-align: center; border-top: 1px dashed var(--line); }
/* 새로 쓰는 길의 보상형 광고(모의) — 전환 화면(#overlay) 위 층 */
#adlayer { position: fixed; inset: 0; z-index: 70; display: flex; background: #05070c; align-items: center; justify-content: center; animation: fade .2s; }
#adlayer .trans { position: relative; }
#adlayer .ad-x { position: absolute; top: 0; right: 8px; background: none; border: 0; color: var(--sub); font-size: 20px; padding: 8px; cursor: pointer; }
#adlayer small { color: var(--sub); font-size: 12px; }
/* 배너 광고 자리(모의) — 둘러보는 화면은 탭바(64px) 바로 위 50px 고정, 읽기 화면은 고정 배너 없이 본문 끝·선택지 앞 인라인 */
#banner { position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 50px; z-index: 28; display: flex; align-items: center; justify-content: center; background: #11151f; border-top: 1px solid var(--line); }
#banner[hidden], #app.reading #banner { display: none; }
#banner span, .banner-inline span { width: 320px; height: 50px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--dim); color: var(--dim); font-size: 12px; }
.banner-inline { display: flex; justify-content: center; margin: 22px 0 6px; }
body.banner #app { padding-bottom: 122px; }
body.banner #app.reading { padding-bottom: 72px; }
body.banner #toast { bottom: 140px; }
body.banner .reading #toast { bottom: 140px; }
/* 새로 쓰는 화: 원고 페이지에서 쓰는 대로 문단이 붙는다(10-05) */
.lp-label { color: var(--sub); font-weight: 600; }
.body .lp-new { animation: fade .5s; }
.lp-more { padding: 0 22px 140px; color: var(--sub); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.lp-more::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: lpblink 1s ease-in-out infinite; }
@keyframes lpblink { 50% { opacity: .2; } }
