/* 캐릭터 상세 페이지 (character-page.js) · 탑툰챗형: 500px 블러 히어로 + 280px 3:4 이미지 + 빨간 막대 섹션 카드 */
.character-page{position:relative;margin:-88px -24px 0;padding-bottom:48px;color:var(--fg)}
.cp-loading{padding:120px 0;text-align:center;color:var(--fg-3)}
.cp-back{position:absolute;z-index:5;top:100px;left:12px;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#0006;border:1px solid #ffffff1a;color:#fff;text-decoration:none}
.cp-back svg{width:16px;height:16px}

/* 히어로 */
.cp-hero{position:relative;z-index:3;display:block;isolation:isolate;padding:128px 24px 32px}
/* 배경 그림은 히어로 밖으로 넘치지 않게(max-height) — 히어로가 짧은 캐릭터에서 아래 컬렉션 제목의 '전체 컬렉션' 버튼 위끝을 덮었다(10-19) */
.cp-hero-bg{position:absolute;inset:0 0 auto;height:564px;max-height:100%;overflow:hidden;z-index:-1}
.cp-backdrop{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;filter:blur(40px) saturate(1.5);transform:scale(1.05)}
.cp-hero-bg::before{content:"";position:absolute;inset:0;z-index:1;background:linear-gradient(to top,var(--bg),#141517cc 50%,#14151733),linear-gradient(to right,#101012b3,transparent 50%,#101012b3)}
.cp-hero-bg::after{content:"";position:absolute;inset:0;z-index:1;background:#10101233}
.cp-hero-inner{max-width:1024px;margin:0 auto;display:flex;gap:40px;align-items:stretch}
.cp-portrait{position:relative;flex:none;width:280px;aspect-ratio:3/4;border-radius:14px;overflow:hidden;background:var(--card);border:1px solid var(--line);box-shadow:0 25px 50px -12px #00000080}
.cp-portrait::after{content:"";position:absolute;inset:0;background:linear-gradient(to bottom right,#ffffff1a,transparent 50%);pointer-events:none}
.cp-portrait img,.cp-portrait video{width:100%;height:100%;object-fit:cover;display:block}
.cp-letter{display:grid;place-items:center;height:100%;font-size:72px;color:var(--fg-3)}
.cp-hero-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:16px;padding-top:16px}
.cp-hero-head{display:flex;flex-direction:column;gap:8px}
.cp-title-row{display:flex;align-items:center;gap:12px;min-width:0}
.cp-title-row h1{margin:0;font-size:48px;line-height:1;font-weight:700;letter-spacing:-.02em;color:#fff;text-shadow:0 10px 8px #0000000a,0 4px 3px #0000001a;overflow-wrap:anywhere}
.cp-actions{display:flex;gap:8px;flex:none}
.cp-icon{display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:18px;background:#ffffff1a;color:#fff;cursor:pointer;transition:background .15s}
.cp-icon:hover{background:#ffffff26}
.cp-icon svg{width:20px;height:20px}
.cp-icon.fav[aria-pressed=true]{color:#f87171}.cp-icon.fav[aria-pressed=true] svg{fill:currentColor}
.cp-icon.done{color:var(--ok)}
.cp-intro{margin:8px 0 0;font-size:20px;line-height:1.4;color:#fffc;text-shadow:0 1px 2px #0003}
.cp-stats{display:flex;flex-wrap:wrap;align-items:center;gap:16px;font-size:14px;color:#ffffffe6}
.cp-stats span{display:inline-flex;align-items:center;gap:6px}
.cp-stats svg{width:16px;height:16px}
.cp-stats b{font-weight:400}
.cp-tags{display:flex;flex-wrap:wrap;gap:6px}
.cp-tags span{display:inline-flex;align-items:center;padding:4px 8px;border-radius:14px;background:#00000073;backdrop-filter:blur(12px);color:#fffc;font-size:13px;font-weight:700;letter-spacing:-.005em}
.cp-start{margin-top:auto;display:flex;flex-direction:column;gap:16px;padding-top:24px}
.cp-field-label{margin:0 0 6px 4px;font-size:13px;font-weight:600;color:var(--teal)}
.cp-select-wrap{position:relative}
.cp-select{display:flex;align-items:center;gap:8px;width:100%;height:50px;padding:0 15px;border:0;border-radius:10px;background:#ffffff1a;backdrop-filter:blur(12px);color:#fff;font:600 14px var(--font-sans);text-align:left;cursor:pointer}
.cp-select:hover{background:#ffffff24}
.cp-select svg{width:16px;height:16px;flex:none;color:#ffffffb3}
.cp-select-text{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cp-select-wrap.open .cp-select svg:last-child{transform:rotate(180deg)}
.cp-options{position:absolute;z-index:20;left:0;right:0;top:calc(100% + 6px);max-height:320px;overflow:auto;padding:6px;border:1px solid var(--line);border-radius:14px;background:#1c1c1ff7;backdrop-filter:blur(16px);box-shadow:0 20px 40px #0009}
.cp-option{display:grid;gap:2px;width:100%;padding:10px 12px;border:0;border-radius:10px;background:none;color:var(--fg);text-align:left;font:inherit;cursor:pointer}
.cp-option:hover{background:#ffffff0f}
.cp-option[aria-selected=true]{background:#e637401f}
.cp-option[aria-selected=true] strong{color:#ff6b72}
.cp-option strong{font-size:14px}.cp-option small{color:var(--fg-3);font-size:12px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cp-cta{display:inline-flex;align-items:center;justify-content:center;gap:8px;height:48px;border:0;border-radius:14px;background:var(--accent);color:#fff;font:700 16px var(--font-sans);cursor:pointer;transition:filter .15s}
.cp-cta:hover{filter:brightness(1.08)}
.cp-cta svg{width:20px;height:20px}
.cp-cta:disabled{opacity:.5;cursor:default}
.cp-cta.small{height:auto;min-height:36px;padding:0 14px;font-size:12px;border-radius:14px}
.cp-cta.small svg{width:16px;height:16px}
.cp-intro-note{color:var(--fg-2);font-size:12px;text-align:center}
.cp-intro-note[hidden]{display:none}
.cp-error{color:#ffb3b4;font-size:13px;margin:0}
.cp-error:empty{display:none}
.cp-draft{margin:0;color:#ffcf8a;font-size:13px}

/* 본문 섹션 */
.cp-body{max-width:1024px;margin:0 auto;padding:24px 24px 0;display:flex;flex-direction:column;gap:40px}
.cp-section{scroll-margin-top:80px;min-width:0}
.cp-heading{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:0 0 16px;font-size:18px;font-weight:700}
.cp-heading::before{content:"";width:4px;height:20px;border-radius:999px;background:var(--accent)}
.cp-count{color:var(--fg-2);font-size:16px;font-weight:400}
.cp-pill{position:relative;display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px 0 8px;overflow:hidden;border:1px solid #e6374040;border-radius:999px;background:linear-gradient(to bottom right,#e637401a,#e6374008),var(--card);color:#fff;font:700 11px var(--font-sans);cursor:pointer}
.cp-pill svg{width:14px;height:14px;color:var(--accent)}
.cp-card{padding:20px;border-radius:14px;background:var(--card)}
.cp-prose p{margin:0 0 12px;color:var(--fg);font-size:14px;font-weight:500;line-height:1.625;letter-spacing:-.005em;white-space:pre-wrap}
.cp-prose p:last-child{margin-bottom:0}
.cp-facts{display:grid;grid-template-columns:120px 1fr;gap:8px 16px;margin:16px 0 0;padding-top:16px;border-top:1px solid #373a3f80}
.cp-facts dt{color:var(--fg-2);font-size:13px}.cp-facts dd{margin:0;font-size:13px;line-height:1.6}
/* 소개 이미지는 카드 안 전체 폭(11-04 고객 — 760px 고정·카드 밖이라 "비율이 안 맞고 따로 논다") · 접기는 이미지·글·정보표를 함께 */
.cp-about-images{display:grid;gap:8px;margin:0 0 16px}.cp-about-images :is(img,video){display:block;width:100%;height:auto;border-radius:10px}
.cp-about-images:last-child{margin-bottom:0}
.cp-about-body[hidden]{display:none}
.cp-facts:first-child{margin:0;padding:0;border:0}
.cp-fold{display:flex;width:fit-content;align-items:center;gap:4px;margin-top:16px;padding:0;border:0;background:none;color:var(--accent);font:600 13px/1 var(--font-sans);cursor:pointer}/* 블록으로 — inline이면 줄 상자 baseline에 얹혀 접힌 카드에서 아래 여백만 남는다(11-04) */
.cp-fold:first-child,.cp-about-body[hidden]+.cp-fold{margin-top:0}
.cp-fold svg{width:14px;height:14px}
.cp-keywords{margin-bottom:12px;font-size:16px;font-weight:700;line-height:1.25}
.cp-meter-note{margin:16px 0 8px;font-size:13px;color:var(--fg-2)}
.cp-meters{display:flex;flex-direction:column;gap:6px}
.cp-meter{display:flex;align-items:center;gap:8px;font-size:13px}
.cp-meter small{width:80px;flex:none;color:var(--fg-2);font-size:13px}
.cp-meter span{flex:1;height:12px;border-radius:999px;background:var(--bg);overflow:hidden}
.cp-meter i{display:block;height:100%;border-radius:999px;background:linear-gradient(to right,#e6374066,#e63740cc,#e63740)}
.cp-meter b{width:40px;text-align:right;font-weight:400;color:#c9cedccc;font-variant-numeric:tabular-nums}

/* 컬렉션 */
.cp-progress{margin-bottom:12px}
.cp-tier-bar{display:flex;gap:2px;height:8px;border-radius:4px;overflow:hidden}
.cp-tier-seg{flex:1 1 0;min-width:6px;background:#2123259a;overflow:hidden}
.cp-tier-seg i{display:block;height:100%;background:currentColor;transition:width .6s cubic-bezier(.4,0,.2,1)}
.cp-tier-legend{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin-top:6px;font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;white-space:pre}
.cp-tier-legend span::before{content:"";display:inline-block;width:5px;height:5px;margin:0 6px 2px 0;border-radius:50%;background:currentColor}
.cp-tier-legend small{margin-left:auto;color:var(--fg-3);font-size:12px}
.cp-progress-bar{height:8px;border-radius:4px;background:#2123259a;overflow:hidden}
.cp-progress-bar i{display:block;height:100%;background:#60a5fa;transition:width .6s cubic-bezier(.4,0,.2,1)}
.cp-progress-legend{display:flex;align-items:center;gap:8px;margin-top:6px;font-size:12px;font-weight:600;color:#60a5fa;font-variant-numeric:tabular-nums}
.cp-progress-legend span::before{content:"";display:inline-block;width:5px;height:5px;margin:0 6px 2px 0;border-radius:50%;background:currentColor}
.cp-progress-legend small{color:var(--fg-3);font-size:12px}
.cp-places{margin-bottom:12px}
.cp-places-head{display:flex;align-items:center;gap:6px;margin:0 0 8px;font-size:13px;font-weight:600;letter-spacing:-.01em;color:var(--fg-2)}
.cp-places-head svg{width:14px;height:14px;color:var(--accent)}
.cp-chips{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none}
.cp-chips::-webkit-scrollbar{display:none}
.cp-chips.dragging{cursor:grabbing}
.cp-chip-rail .tt-rail-arrow{width:28px;height:28px}
.cp-chip{flex:none;display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:14px;background:var(--card);font-size:13px;white-space:nowrap}
.cp-chip b{font-weight:700}.cp-chip small{font-size:13px;font-weight:600;color:var(--fg-2)}
.cp-collection-row{display:flex;gap:12px;overflow-x:auto;padding-bottom:12px;scroll-snap-type:x mandatory;scrollbar-width:none}
.cp-collection-row::-webkit-scrollbar{display:none}
.cp-collection-row.dragging{scroll-snap-type:none;cursor:grabbing}
.cp-collection-row.dragging .collection-tile{pointer-events:none}
.cp-collection-rail .tt-rail-arrow{top:calc(50% - 6px);opacity:1}
.cp-collection-rail .tt-rail-arrow.prev{left:-18px}.cp-collection-rail .tt-rail-arrow.next{right:-18px}
.cp-collection-row .collection-groups,.cp-collection-row .collection-group,.cp-collection-row .collection-grid{display:contents}
.cp-collection-row .collection-group>header{display:none}
.cp-collection-row .collection-tile{flex:none;width:160px;aspect-ratio:3/4;border-radius:14px;scroll-snap-align:start;box-shadow:inset 0 0 0 1px #373a3f4d}
.cp-collection-row .collection-tile.locked .tile-art{filter:blur(4px);transform:scale(1.05)}
.cp-collection-row .collection-tile.locked::after{content:"";position:absolute;inset:0;background:#0003;pointer-events:none}
.cp-collection-row .tile-lock{top:50%;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#00000080;backdrop-filter:blur(4px);z-index:1}
.cp-collection-row .tile-lock svg{width:16px;height:16px}
.cp-collection-row .collection-tile.locked figcaption{z-index:1}
.cp-collection-row .collection-empty{padding:0;margin:auto 0}
.cp-collection-lead{flex:none;width:160px;aspect-ratio:3/4;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;padding:16px;border-radius:14px;background:linear-gradient(to bottom right,#e637401a,var(--card),#2123259a);box-shadow:inset 0 0 0 1px #373a3f4d;text-align:center;scroll-snap-align:start}
.cp-lead-icon{display:grid;place-items:center;width:40px;height:40px;margin-top:12px;border-radius:50%;background:#e637401a;color:var(--accent)}
.cp-lead-icon svg{width:20px;height:20px}
.cp-collection-lead p{margin:8px 0 0;font-size:12px;font-weight:500;line-height:1.375}
.cp-lead-cta{margin-top:auto;width:100%;height:36px;border:0;border-radius:14px;background:var(--accent);color:#fff;font:700 12px var(--font-sans);cursor:pointer}

/* 첫 메시지 미리보기 */
.cp-first-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:12px}
.cp-first-head h3{margin:0;font-size:17px;font-weight:700;letter-spacing:-.015em;line-height:1.375}
.cp-first-badges{display:flex;gap:6px;flex:none;margin-top:2px}
.cp-tag-red{padding:2px 8px;border-radius:8px;background:#e6374026;color:var(--accent);font-size:11px;font-weight:700}
.cp-comment{margin-bottom:16px;padding:12px 16px;border:1px solid #e6374033;border-radius:14px;background:#e6374014}
.cp-comment-title{display:flex;align-items:center;gap:6px;margin-bottom:8px;color:var(--accent);font-size:11px;font-weight:700}
.cp-comment-title svg{width:14px;height:14px}
.cp-comment p{margin:0;color:#fffc;font-size:14px;line-height:1.625;white-space:pre-wrap}
.cp-thread{display:flex;flex-direction:column;gap:10px;margin-bottom:16px}
.cp-narration{margin:0 16px;color:#c9cedcb3;font-size:12px;font-style:italic;line-height:1.5;text-align:center}
.cp-line{display:flex;gap:10px}
.cp-face{flex:none;width:32px;height:32px;margin-top:2px;border-radius:50%;overflow:hidden;background:var(--tile);box-shadow:0 0 0 1px var(--line)}
.cp-face img{width:100%;height:100%;object-fit:cover;object-position:center top}
.cp-line-col{flex:1;min-width:0}
.cp-line-col b{display:block;margin-bottom:4px;font-size:13px}
.cp-bubble{display:inline-block;max-width:90%;padding:12px 16px;border:1px solid #ffffff0f;border-radius:6px 18px 18px;background:#ffffff0f;font-size:14px;line-height:1.625;white-space:pre-wrap}
.cp-more-link{align-self:flex-start;margin-top:8px;padding:0;border:0;background:none;color:var(--accent);font:700 12px var(--font-sans);cursor:pointer}

/* 댓글 */
.cp-comment-form{position:relative;margin-bottom:16px}
.cp-comment-form textarea{display:block;width:100%;box-sizing:border-box;min-height:64px;padding:10px 64px 10px 12px;border:1px solid #373a3f66;border-radius:8px;background:#2123254d;color:var(--fg);font:14px/1.5 var(--font-sans);resize:vertical}
.cp-comment-form textarea:disabled{opacity:.7}
.cp-comment-form .cp-cta.small{position:absolute;right:8px;bottom:8px;min-height:32px;padding:0 12px}
.cp-comment-form .cp-error{margin-top:6px}
.cp-comments{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.cp-comments li{padding:12px 0}
.cp-comments li+li{border-top:1px solid #373a3f4d}
.cp-comments li.mine strong{color:var(--accent)}
.cp-comment-head{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.cp-comment-head strong{font-size:14px;font-weight:600}
.cp-comment-head time{color:var(--fg-2);font-size:12px}
.cp-comments p{margin:0;color:#ffffffe6;font-size:14px;line-height:1.625;white-space:pre-wrap}
.cp-empty{color:var(--fg-3);text-align:center;font-size:14px}
.cp-link{margin-left:auto;border:0;background:none;color:var(--fg-3);font:inherit;font-size:12px;cursor:pointer}
.cp-more{display:block;margin:12px auto 0;padding:8px 18px;border:1px solid var(--line);border-radius:999px;background:none;color:var(--fg-2);font:600 13px var(--font-sans);cursor:pointer}
.cp-more[hidden]{display:none}
.cp-staff{display:flex;gap:14px;font-size:13px}.cp-staff a{color:var(--fg-3)}
.cp-dock{display:none}
@media(max-width:767px){.cp-dock:not([hidden]){display:block;position:fixed;z-index:45;left:0;right:0;bottom:calc(64px + env(safe-area-inset-bottom));padding:12px 16px;background:linear-gradient(transparent,var(--bg) 40%)}.cp-dock .cp-cta{width:100%;box-shadow:0 8px 24px #0009}}

@media(max-width:1023px){.cp-hero-inner{gap:28px}.cp-portrait{width:240px}.cp-title-row h1{font-size:40px}}
@media(max-width:767px){
  .character-page{margin:-80px -16px 0}
  .cp-back{top:92px;left:12px}
  .cp-hero{padding:0}
  .cp-hero-bg{position:relative;inset:auto;height:auto;aspect-ratio:3/4;max-height:78vh;margin-top:64px}
  .cp-backdrop{filter:none;transform:none;object-position:center top}
  .cp-hero-bg::before{background:linear-gradient(to top,var(--bg) 2%,#14151799 32%,transparent 62%)}
  .cp-hero-bg::after{display:none}
  .cp-hero-inner{display:block}
  .cp-portrait{display:none}
  .cp-hero-copy{position:relative;margin-top:-132px;padding:0 16px;gap:12px}
  .cp-title-row h1{font-size:30px}
  .cp-intro{font-size:15px}
  .cp-stats{font-size:12px;gap:12px}
  .cp-tags span{font-size:12px}
  .cp-body{padding:24px 16px 0;gap:32px}
  .cp-card{padding:16px}
  .cp-facts{grid-template-columns:96px 1fr}
  .cp-collection-row .collection-tile,.cp-collection-lead{width:130px}
  .cp-collection-rail .tt-rail-arrow:not([hidden]){display:grid;width:30px;height:30px}
  .cp-collection-rail .tt-rail-arrow.prev{left:8px}.cp-collection-rail .tt-rail-arrow.next{right:8px}
}
/* 일반 사용자에게는 제작 진입점을 숨긴다 (character-page.js가 body.can-create를 붙인다) */
body:not(.can-create) :is(.site-top .studio-button,.catalog-create,.creator-banner,.platform-rail a[href="/create"],.mobile-nav a[href="/create"],.rail-bottom,.character-create){display:none!important}
