/* 해운사 캐릭터 관리 — 사이트 본편과 같은 한지·먹빛 톤 */
[hidden] { display: none !important; }
:root {
  --ink: #2a241d; --ink-soft: #6a5f52; --paper: #f8f3e9; --line: rgba(70, 52, 34, 0.16);
  --red: #b8432f; --green: #23706b; --gold: #d6a23f;
  --font-title: 'Gowun Batang', 'Nanum Myeongjo', serif;
  --font-body: 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #efe8da; color: var(--ink); font: 15px/1.5 var(--font-body); }
.top { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 18px; background: rgba(248, 243, 233, 0.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { display: flex; gap: 10px; align-items: center; }
.brand h1 { margin: 0; font: 400 19px/1.2 var(--font-title); }
.brand p { margin: 0; color: var(--ink-soft); font-size: 12.5px; }
.seal { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; background: var(--red); color: #fff6ea; font: 20px serif; }
.top-actions { display: flex; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--red); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); border-color: rgba(184, 67, 47, 0.4); background: transparent; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.file { cursor: pointer; }
.card { margin: 32px auto; max-width: 440px; padding: 22px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); }
.card h2 { margin: 0 0 6px; font: 400 20px var(--font-title); }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
input, select, textarea { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font: inherit; color: var(--ink); }
textarea { height: auto; padding: 8px 10px; resize: vertical; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-soft); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
label.check input { width: 18px; height: 18px; }
.muted { color: var(--ink-soft); }
.small { font-size: 12px; }
.msg { min-height: 1.4em; margin: 8px 0 0; color: var(--red); font-size: 13.5px; }
main { padding: 16px 18px 40px; max-width: 1200px; margin: 0 auto; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.kinds { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.card-item { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); cursor: pointer; font: inherit; color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.card-item:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(40, 30, 20, 0.12); }
.card-item.is-hidden { opacity: 0.55; }
.card-item img { height: 130px; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.2)); }
.card-item .noimg { height: 130px; display: grid; place-items: center; color: var(--ink-soft); font-size: 13px; }
.card-item strong { font-weight: 600; font-size: 14px; text-align: center; word-break: keep-all; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.tag { padding: 1px 8px; border-radius: 999px; background: rgba(70, 52, 34, 0.08); font-size: 11.5px; }
.tag.npc { background: rgba(35, 112, 107, 0.15); color: var(--green); }
.tag.coach { background: rgba(214, 162, 63, 0.2); color: #8a6516; }
.tag.off { background: rgba(184, 67, 47, 0.12); color: var(--red); }
.editor { width: min(860px, calc(100vw - 20px)); max-height: calc(100vh - 20px); padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); color: var(--ink); }
.editor::backdrop { background: rgba(20, 14, 8, 0.45); }
.ed-head, .ed-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; }
.ed-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.ed-head h2 { margin: 0; font: 400 19px var(--font-title); }
.ed-foot { border-top: 1px solid var(--line); }
.ed-foot .spacer { flex: 1; }
.ed-body { display: grid; grid-template-columns: 240px 1fr; gap: 18px; padding: 16px; }
.ed-img { display: grid; gap: 8px; align-content: start; }
.img-box { height: 260px; display: grid; place-items: center; border-radius: 12px; background: repeating-conic-gradient(#e7e0d2 0% 25%, #f4efe5 0% 50%) 50% / 18px 18px; }
.img-box img { max-height: 250px; max-width: 100%; }
.ed-fields { display: grid; gap: 10px; align-content: start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
fieldset.npc { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 8px; }
fieldset.npc legend { padding: 0 4px; }
#npcFields { display: grid; gap: 8px; }
#npcFields[hidden] { display: none; }
.yard-pick { position: relative; border-radius: 10px; overflow: hidden; cursor: crosshair; }
.yard-pick img { display: block; width: 100%; height: auto; }
.pin { position: absolute; width: 16px; height: 16px; margin: -16px 0 0 -8px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--red); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); pointer-events: none; }
@media (max-width: 700px) {
  .ed-body { grid-template-columns: 1fr; }
  .img-box { height: 200px; }
}

/* 탭 · 풍경 설정 */
.tabs { display: flex; gap: 6px; }
.panel-card { margin: 0 0 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.panel-card h2 { margin: 0 0 4px; font: 400 19px var(--font-title); }
.panel-card h3 { margin: 18px 0 6px; font: 400 16px var(--font-title); }
label.check.big { font-size: 15px; margin: 10px 0 2px; }
.slot { padding: 10px 0; border-top: 1px dashed var(--line); }
.slot-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.slot-head strong { min-width: 64px; font-weight: 600; }
.slot-head input { max-width: 220px; height: 32px; }
.slot-fields { display: grid; grid-template-columns: 110px 140px 1fr; gap: 8px; }
.slot-fields label.wide { grid-column: auto; }
.slot-thumbs { margin-top: 6px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.th { position: relative; width: 96px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #ddd2bf; }
.th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th b { position: absolute; left: 3px; top: 3px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, 0.62); color: #ffe2b0; font-size: 11.5px; font-weight: 500; }
.th.bad { outline: 2px solid var(--red); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.gal { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.gal li { display: grid; gap: 4px; }
.gal a { position: relative; display: block; border-radius: 8px; overflow: hidden; background: #ddd2bf; }
.gal img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gal .no { position: absolute; left: 4px; top: 4px; padding: 1px 7px; border-radius: 8px; background: rgba(0, 0, 0, 0.66); color: #ffe2b0; font-size: 12px; }
.gal .title { font-size: 13px; }
.tag.k4 { background: #2a241d; color: #ffe2b0; }
.tag.use { background: rgba(35, 112, 107, 0.14); color: var(--green); }
@media (max-width: 640px) {
  .slot-fields { grid-template-columns: 1fr 1fr; }
  .slot-fields label.wide { grid-column: 1 / -1; }
  .top { flex-wrap: wrap; }
}

/* 3D · 동작 */
fieldset.motion { margin-top: 12px; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 12px; }
fieldset.motion legend { padding: 0 6px; font-weight: 600; font-size: 13.5px; }
.m3d-view { position: relative; width: 100%; aspect-ratio: 0.86; margin: 6px 0; border-radius: 10px; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #4a4036, #1e1914); }
.kit-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.m3d-acts, .m3d-file { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.tag.m3d { background: #2a241d; color: #ffe2b0; }
.tag.req { background: rgba(184, 67, 47, 0.14); color: var(--red); }
/* 수행 단계 탭 */
.prog-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 84px 130px auto; gap: 8px; align-items: end; padding: 8px 0; border-top: 1px dashed var(--line); }
.prog-row strong { align-self: center; font-weight: 600; }
.prog-row label, #progressView label { display: grid; gap: 4px; font-size: 13px; }
#progressView label.check { display: flex; align-items: center; gap: 6px; }
#progressView input[type='number'] { max-width: 160px; }
.row-actions { display: flex; gap: 8px; margin-top: 14px; }
/* 수행 단계 미리보기: 왼쪽 수치, 오른쪽 실제 사이트(iframe) */
.prog-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); gap: 16px; align-items: start; }
.prog-preview { position: sticky; top: 12px; display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.prog-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prog-modes { display: flex; gap: 6px; }
.prog-frame { width: 100%; height: min(76vh, 760px); border: 0; border-radius: 12px; background: #15171d; }
.prog-quick, .prog-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prog-chips { margin-top: 8px; }
.prog-inline { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.prog-status { margin: 0; }
.btn.prog-pv { white-space: nowrap; }
@media (max-width: 1100px) {
  .prog-layout { grid-template-columns: 1fr; }
  .prog-preview { position: static; order: -1; }
  .prog-frame { height: 62vh; }
}
@media (max-width: 700px) { .prog-row { grid-template-columns: 1fr 1fr; } .prog-row strong { grid-column: 1 / -1; } }

