/* 고즈넉 — 디자인 토큰과 화면 (docs/UX_DESIGN.md §2.2). 제목 글꼴: 고운바탕(OFL, web/fonts) */
@font-face { font-family: "Gowun Batang"; src: url("/fonts/GowunBatang-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gowun Batang"; src: url("/fonts/GowunBatang-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
:root {
  --ink: #232C2A;
  --ink-2: #4A5550;
  --ink-3: #6B746F;
  --pine: #31574C;
  --pine-2: #264539;
  --mist: #DFE8E1;
  --hanji: #F5F0E7;
  --paper: #FFFDF8;
  --line: #DDD5C7;
  --brass: #B58B55;
  --brass-text: #7A5A2E;
  --lantern: #F2C77B;
  --ad-bg: #5B4A2E;
  --ad-fg: #FFF7E8;
  --danger: #9B3B2F;
  --ok: #2F6B4F;
  --focus: #31574C;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(35, 44, 42, .06), 0 8px 24px rgba(35, 44, 42, .06);
  --serif: "Gowun Batang", "Nanum Myeongjo", "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  --seal: #B23A2B;
  --glass: rgba(250, 247, 240, .74);
  --glass-line: rgba(255, 255, 255, .55);
  --glass-ink: #1F2A26;
  --sans: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --ink: #EDE7DA; --ink-2: #CFC8BA; --ink-3: #A39D90; --pine: #8FC2AE; --pine-2: #A8D3C1; --mist: #22302B;
  --hanji: #161C1A; --paper: #1D2421; --line: #33403B; --brass-text: #E0BC88; --danger: #E08A7C; --ok: #8FCFA9; --focus: #8FC2AE;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #EDE7DA; --ink-2: #CFC8BA; --ink-3: #A39D90; --pine: #8FC2AE; --pine-2: #A8D3C1; --mist: #22302B;
    --hanji: #161C1A; --paper: #1D2421; --line: #33403B; --brass-text: #E0BC88; --danger: #E08A7C; --ok: #8FCFA9; --focus: #8FC2AE;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--hanji); color: var(--ink); font: 16px/1.7 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; outline: none; }
main:focus-visible { outline: none; } /* 화면을 바꿀 때 낭독기를 위해 본문에 초점을 옮긴다(테두리는 안 그림) */
a { color: var(--pine); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.35; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 3.2vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
svg { display: block; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--paper); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* 상단바 */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; padding: 10px max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--hanji) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); white-space: nowrap; flex-shrink: 0; }
@media (max-width: 480px) { .brand-ko { letter-spacing: .12em; } }
.brand svg { width: 26px; height: 26px; fill: none; stroke: var(--pine); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-ko { font-family: var(--serif); font-size: 1.3rem; letter-spacing: .25em; }
.brand-seal { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; background: var(--seal); color: #FFF3E6; font-family: var(--serif); font-size: .72rem; transform: rotate(-4deg); }
.mainnav { display: flex; gap: 2px; margin-left: 8px; flex-wrap: wrap; }
.mainnav a { padding: 8px 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.mainnav a:hover, .mainnav a[aria-current="page"] { background: var(--mist); color: var(--ink); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: transparent; border-radius: 12px; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--mist); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#sound-toggle[aria-pressed="false"] .sound-on, #sound-toggle[aria-pressed="true"] .sound-off { display: none; }
.me-link { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); white-space: nowrap; min-height: 40px; display: inline-flex; align-items: center; max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
.me-link.join { background: var(--pine); color: #fff; border-color: var(--pine); }
.topbar { min-width: 0; }
.tools { min-width: 0; flex-shrink: 1; }
/* 휴대폰: 이름이 길면 메뉴 버튼이 화면 밖으로 밀려 잘렸다 */
@media (max-width: 520px) {
  .topbar { gap: 8px; }
  .tools { gap: 2px; }
  .icon-btn { width: 40px; height: 40px; }
  .me-link { padding: 6px 10px; font-size: .9rem; max-width: 30vw; display: block; line-height: 26px; }
  .me-link.join { display: none; }
  .brand-seal { display: none; }
}
.menu-btn { display: none; }
.mobile-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 16px 14px; background: var(--hanji); border-bottom: 1px solid var(--line); position: sticky; top: 64px; z-index: 29; }
.mobile-nav a { padding: 10px; text-align: center; border-radius: 10px; background: var(--paper); text-decoration: none; color: var(--ink); }
@media (max-width: 960px) { .mainnav { display: none; } .menu-btn { display: inline-grid; } }

/* 공통 레이아웃 */
.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 28px 16px 56px; }
.wrap.narrow { width: min(760px, 100%); }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card h2, .card h3 { margin-top: 0; }
a.card { text-decoration: none; color: inherit; transition: border-color .15s; }
a.card:hover { border-color: var(--pine); }
a.card h2, a.card h3 { color: var(--pine); }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; background: var(--mist); color: var(--ink-2); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill.warn { background: color-mix(in srgb, var(--brass) 22%, transparent); color: var(--brass-text); }
.pill.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ad-badge { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--ad-bg); color: var(--ad-fg); font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.notice-box { border-left: 3px solid var(--brass); padding: 10px 14px; background: color-mix(in srgb, var(--lantern) 14%, var(--paper)); border-radius: 0 10px 10px 0; }
.empty { padding: 28px; text-align: center; color: var(--ink-3); }

/* 버튼·폼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--pine); }
.btn.primary { background: var(--pine); color: #fff; border-color: var(--pine); }
:root[data-theme="dark"] .btn.primary { color: #10201A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #10201A; } }
.btn.primary:hover { background: var(--pine-2); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.big { min-height: 52px; padding: 0 24px; font-size: 1.05rem; border-radius: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: .9rem; color: var(--ink-2); margin-bottom: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
}
textarea { min-height: 96px; resize: vertical; }
.field + .field { margin-top: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 3px; }
.err { color: var(--danger); font-size: .9rem; min-height: 1.2em; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--ink-3); font-weight: 500; }
.table-scroll { overflow-x: auto; }

/* 부트·토스트 */
.boot { min-height: 60vh; display: grid; place-content: center; text-align: center; }
.boot-title { font-family: var(--serif); font-size: 1.8rem; letter-spacing: .4em; margin: 0; }
.boot-msg { color: var(--ink-3); }
.toast-zone { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { background: var(--ink); color: var(--hanji); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); animation: rise .25s ease-out; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ── 풍경 (2.5D) ── */
.hero { position: relative; overflow: hidden; min-height: min(78vh, 720px); display: grid; align-items: end; color: #fff; isolation: isolate; }
.scene { position: absolute; inset: 0; z-index: -1; }
.scene svg { width: 100%; height: 100%; }
.scene .layer { transition: transform .6s ease-out; will-change: transform; }
.scene .drift { animation: drift 60s linear infinite alternate; }
.scene .drift.slow { animation-duration: 110s; }
@keyframes drift { to { transform: translateX(-80px); } }
.particles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.particles i { position: absolute; top: -20px; display: block; animation: fall linear infinite; opacity: .8; }
.particles.spring i { width: 8px; height: 6px; border-radius: 60% 0; background: #F6C9D0; }
.particles.summer i { width: 1px; height: 16px; background: rgba(220, 235, 255, .55); }
.particles.autumn i { width: 9px; height: 7px; border-radius: 0 70%; background: #C9622E; }
.particles.winter i { width: 5px; height: 5px; border-radius: 50%; background: #fff; }
@keyframes fall { to { transform: translate3d(-60px, 110vh, 0) rotate(300deg); } }
/* 글자 가독성: 풍경 위에 아래쪽부터 옅은 그늘(::after 는 풍경보다 나중에 그려진다) */
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(to top, rgba(15, 20, 18, .55), rgba(15, 20, 18, 0) 58%); }
.hero-copy { padding: 0 16px 36px; width: min(1180px, 100%); margin: 0 auto; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.hero-copy > * { max-width: 620px; }
.hero-copy .eyebrow { letter-spacing: .3em; font-size: .85rem; opacity: .9; }
.hero-copy h1 { font-size: clamp(2rem, 5vw, 3.4rem); color: #fff; margin-bottom: .3em; }
.hero-copy .today { font-size: 1.05rem; opacity: .95; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-actions .btn { background: rgba(255,255,255,.92); color: #1E2A26; border: 0; }
.hero-actions .btn.primary { background: var(--lantern); color: #2B2416; }
.hero-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: .9rem; }
.hero-meta span { background: rgba(20, 28, 25, .45); padding: 4px 12px; border-radius: 999px; backdrop-filter: blur(6px); }
.hotspots { position: absolute; inset: 0; pointer-events: none; }
.hotspot { position: absolute; pointer-events: auto; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(20, 28, 25, .55); color: #fff; text-decoration: none; font-size: .9rem; backdrop-filter: blur(6px); min-height: 36px; }
.hotspot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--lantern); box-shadow: 0 0 0 4px rgba(242, 199, 123, .3); }
.hotspot:hover, .hotspot:focus-visible { background: rgba(20, 28, 25, .8); }
/* 핫스팟은 오른쪽(x ≥ 60%)에만 두고, 문구와 겹칠 수 있는 폭에서는 숨긴다(같은 곳은 CTA·메뉴로 갈 수 있음) */
@media (max-width: 1080px) { .hotspots { display: none; } }
@media (max-width: 640px) { .hero { min-height: 68vh; } }

/* ── 홍보 10석 ── */
.slots-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.slot { position: relative; display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 190px; text-decoration: none; color: var(--ink); }
.slot .thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--mist), var(--hanji)); object-fit: cover; width: 100%; }
.slot .body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.slot .no { position: absolute; top: 8px; right: 8px; font-size: .72rem; background: rgba(255,255,255,.85); color: #333; padding: 0 6px; border-radius: 6px; }
.slot .title { font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.slot .sum { font-size: .82rem; color: var(--ink-3); overflow-wrap: anywhere; }
.slot.empty-slot { border-style: dashed; align-items: center; justify-content: center; text-align: center; color: var(--ink-3); padding: 16px; background: transparent; }
.slot.empty-slot strong { color: var(--ink-2); font-weight: 500; }

/* ── 법당 ── */
.hall { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .hall { grid-template-columns: 1fr; } }
.floor svg { width: 100%; height: auto; }
.floor .cushion { transition: fill .2s; }
.floor .cushion.pulse { animation: pulse 1.2s ease-out; }
@keyframes pulse { 0% { transform-box: fill-box; transform-origin: center; transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.counter { font-family: var(--serif); font-size: 2.2rem; line-height: 1; }
.rosary { width: 100%; max-width: 280px; margin: 0 auto; touch-action: none; cursor: grab; }
.rosary .bead { fill: #8B5E3C; }
.rosary .bead.done { fill: #C49A6C; }
.rosary .bead.now { fill: var(--lantern); }
.prayer { display: flex; align-items: center; gap: 10px; }
.kbd { display: inline-block; min-width: 1.6em; padding: 0 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; font-size: .8rem; text-align: center; color: var(--ink-2); }
.btn.primary .kbd { color: inherit; border-color: rgba(255, 255, 255, .55); }
@media (hover: none) { .kbd { display: none; } }
.events { min-height: 1.6em; color: var(--ink-3); font-size: .9rem; }
.meter { height: 8px; border-radius: 99px; background: var(--mist); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--pine); border-radius: 99px; transition: width .3s; }

/* ── 채팅 ── */
.chat { display: grid; grid-template-rows: auto 1fr auto; min-height: 420px; max-height: 70vh; }
.chat.compact { min-height: 300px; max-height: 420px; }
.chat-log { overflow-y: auto; padding: 8px 2px; display: grid; gap: 10px; align-content: start; overscroll-behavior: contain; }
.msg { display: grid; gap: 2px; }
.msg .who { font-size: .82rem; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.msg .who b { color: var(--ink-2); font-weight: 600; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .menu { margin-left: auto; border: 0; background: none; color: var(--ink-3); cursor: pointer; min-width: 32px; min-height: 28px; border-radius: 8px; }
.msg .menu:hover { background: var(--mist); }
.msg.system .text { color: var(--ink-3); font-size: .85rem; }
.chat-form { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.chat-form textarea { min-height: 44px; height: 44px; }
.chat-form .btn { flex-shrink: 0; white-space: nowrap; }
.maru { display: grid; grid-template-columns: 240px minmax(0, 1fr) 220px; gap: 16px; }
@media (max-width: 1000px) { .maru { grid-template-columns: 1fr; } .maru .people { display: none; } }
.roomlist a { display: flex; justify-content: space-between; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.roomlist a[aria-current="true"], .roomlist a:hover { background: var(--mist); }
.popover { position: absolute; z-index: 40; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; min-width: 160px; }
.popover button { text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.popover button:hover { background: var(--mist); }

/* ── 수행일지 ── */
.cal { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.cal div { aspect-ratio: 1; border-radius: 8px; background: var(--mist); display: grid; place-items: center; font-size: .72rem; color: var(--ink-3); }
.cal div.on { background: color-mix(in srgb, var(--pine) 70%, transparent); color: #fff; }
.cal div.on2 { background: var(--pine); color: #fff; }
.todo li { list-style: none; padding: 4px 0; }
.todo { padding: 0; margin: 0; }

/* ── 연등 ── */
.lanterns { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.lantern { text-align: center; padding: 14px 10px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.lantern svg { width: 54px; height: 70px; margin: 0 auto 6px; }
.lantern .m { font-size: .85rem; overflow-wrap: anywhere; }

/* ── 홍보 캘린더 ── */
.avail { border-collapse: separate; border-spacing: 3px; font-size: .78rem; }
.avail th, .avail td { border: 0; padding: 0; text-align: center; }
.avail td button { width: 100%; min-width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-size: .72rem; }
.avail td.free button:hover { border-color: var(--pine); }
.avail td.booked button { background: var(--ink-3); color: #fff; cursor: not-allowed; }
.avail td.held button { background: repeating-linear-gradient(45deg, var(--mist), var(--mist) 4px, var(--paper) 4px, var(--paper) 8px); cursor: not-allowed; }
.avail td.past button { opacity: .35; cursor: not-allowed; }
.avail td.pick button { background: var(--pine); color: #fff; border-color: var(--pine); }

/* ── 관리자 ── */
.admin { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; }
@media (max-width: 860px) { .admin { grid-template-columns: 1fr; } }
.admin nav { display: grid; gap: 2px; align-content: start; }
.admin nav button { text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.admin nav button[aria-current="true"] { background: var(--mist); color: var(--ink); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.kpi { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); }
.kpi .v { font-family: var(--serif); font-size: 1.6rem; }
.kpi .l { font-size: .82rem; color: var(--ink-3); }
pre.json { white-space: pre-wrap; font-size: .8rem; background: var(--mist); padding: 10px; border-radius: 10px; overflow-x: auto; }

/* 모달 */
dialog { border: 1px solid var(--line); border-radius: 16px; padding: 22px; background: var(--paper); color: var(--ink); width: min(460px, calc(100% - 32px)); box-shadow: var(--shadow); max-height: min(88dvh, 760px); overflow: auto; overscroll-behavior: contain; }
dialog .dlg-actions { justify-content: flex-end; margin-top: 14px; position: sticky; bottom: -22px; padding: 10px 0 4px; background: var(--paper); }
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
dialog::backdrop { background: rgba(20, 24, 22, .45); }

.footer { border-top: 1px solid var(--line); padding: 22px 16px 32px; text-align: center; color: var(--ink-3); font-size: .85rem; }
.footer nav { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.footer a { color: var(--ink-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .particles { display: none; }
}

/* ── 3D 산사 ── */
.world { position: relative; height: calc(100vh - 66px); height: calc(100dvh - 66px); min-height: 480px; overflow: hidden; background: #1c2420; touch-action: none; }
.world-canvas { position: absolute; inset: 0; }
.world-canvas canvas { width: 100%; height: 100%; display: block; }
.world-tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.world-tag { position: absolute; left: 0; top: 0; padding: 2px 8px; border-radius: 999px; background: rgba(18, 24, 21, .62); color: #fff; font-size: .78rem; white-space: nowrap; will-change: transform; }
.world-tag small { opacity: .75; }
.world-tag .sprout { margin-right: 3px; }
.world-tag.portal { background: rgba(242, 199, 123, .92); color: #2B2416; font-weight: 600; }
.world-bubble { position: absolute; left: 0; top: 0; max-width: 220px; padding: 6px 10px; border-radius: 12px; background: #fff; color: #222; font-size: .85rem; box-shadow: var(--shadow); white-space: normal; overflow-wrap: anywhere; will-change: transform; }
.world-hud { position: absolute; inset: 0; pointer-events: none; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.world-hud > * { pointer-events: auto; }
.world-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.world-top strong { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); font-family: var(--serif); font-size: 1.15rem; }
.world-status { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.6); margin: 0; }
.world-prompt { align-self: center; margin-top: auto; margin-bottom: 72px; }
.world-card { position: absolute; right: 12px; top: 64px; width: min(320px, calc(100% - 24px)); max-height: 60%; overflow: auto; }
.world-card .note-text { font-size: 1.05rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.praise-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .88rem; border-radius: 10px; }
/* 행동 막대: 예전 left:50%+이동은 폭이 화면 절반으로 묶여 휴대폰에서 두 줄로 접혔다 */
.world-actions { position: absolute; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; pointer-events: none; }
.world-actions > * { pointer-events: auto; }
.world-actions .btn { background: rgba(255, 253, 248, .92); }
.world-chat { position: absolute; left: 12px; bottom: 70px; width: min(360px, calc(100% - 24px)); display: grid; gap: 6px; justify-items: start; }
.world-chat .chat { display: none; width: 100%; }
.world-chat.open .chat { display: grid; }
@media (max-width: 640px) { .world-chat { bottom: 84px; } .world-card { top: auto; bottom: 84px; max-height: 50%; } }

/* 장터·옷장 */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.item { display: grid; gap: 6px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); }
.item .swatch { height: 64px; border-radius: 10px; display: grid; place-items: center; font-size: 1.6rem; }
.item .price { font-weight: 600; }
.wardrobe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
@media (max-width: 860px) { .wardrobe { grid-template-columns: 1fr; } }
.preview3d { height: 420px; border-radius: var(--radius); overflow: hidden; background: linear-gradient(#DFE8E1, #F5F0E7); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.swatches button[aria-pressed="true"] { border-color: var(--pine); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pine) 30%, transparent); }
.slotrow { display: flex; gap: 6px; flex-wrap: wrap; }
.slotrow button[aria-pressed="true"] { background: var(--pine); color: #fff; border-color: var(--pine); }

.world-top .pill { background: rgba(18, 24, 21, .62); color: #fff; }

/* ═══════════ 고즈넉 몰입 화면(첫 화면·3D) ═══════════ */
body.immersive { overflow: hidden; }
body.immersive .footer { display: none; }
body.immersive .topbar { position: fixed; left: 0; right: 0; top: 0; background: linear-gradient(to bottom, rgba(12, 18, 16, .42), rgba(12, 18, 16, 0)); border-bottom: 0; backdrop-filter: none; }
body.immersive .topbar .brand, body.immersive .topbar .mainnav a, body.immersive .topbar .icon-btn { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .35); }
body.immersive .topbar .brand svg { stroke: #fff; }
body.immersive .topbar .mainnav a:hover, body.immersive .topbar .mainnav a[aria-current="page"] { background: rgba(255, 255, 255, .16); color: #fff; }
body.immersive .topbar .icon-btn:hover { background: rgba(255, 255, 255, .16); }
body.immersive .me-link { color: #fff; border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); backdrop-filter: blur(8px); }
body.is-title .topbar .mainnav { visibility: hidden; }
body.immersive .world { height: 100vh; height: 100dvh; }
body.immersive .world-hud { padding-top: 70px; }

.glass { background: var(--glass); color: var(--glass-ink); border: 1px solid var(--glass-line); border-radius: 18px; backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 10px 30px rgba(20, 30, 26, .18); }
:root[data-theme="dark"] .glass { background: rgba(22, 30, 27, .7); color: #EDE7DA; border-color: rgba(255, 255, 255, .12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .glass { background: rgba(22, 30, 27, .7); color: #EDE7DA; border-color: rgba(255, 255, 255, .12); } }
.btn.gz-primary { background: linear-gradient(180deg, #F6D58E, #E7B65E); color: #2B2416; border: 0; box-shadow: 0 6px 18px rgba(199, 140, 50, .35), inset 0 1px 0 rgba(255, 255, 255, .6); font-weight: 600; }
.btn.gz-primary:hover { filter: brightness(1.05); }
.linkish { border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 2px; min-height: 32px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); background: rgba(14, 20, 18, .42); color: #fff; font-size: .85rem; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); white-space: nowrap; cursor: default; }
button.chip { cursor: pointer; }
button.chip:hover { background: rgba(14, 20, 18, .6); }
.chip.warm { background: rgba(242, 199, 123, .28); border-color: rgba(242, 199, 123, .6); }

/* 첫 화면 */
.title-scene { position: relative; height: 100vh; height: 100dvh; overflow: hidden; background: #0d1412; touch-action: manipulation; }
.title-scene .world-canvas { position: absolute; inset: 0; }
.title-scene .world-canvas canvas, .world .world-canvas canvas { width: 100%; height: 100%; display: block; }
.title-veil, .world-veil { position: absolute; inset: 0; background: #0d1412; pointer-events: none; transition: opacity 1.6s ease; z-index: 2; }
.title-veil.clear, .world-veil.clear { opacity: 0; }
.title-scene.leaving .title-ui { opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; }
.title-status { position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%); color: rgba(255, 255, 255, .8); z-index: 3; letter-spacing: .08em; }
.title-ui { position: absolute; inset: 0; z-index: 3; display: grid; grid-template-rows: 1fr auto auto auto; justify-items: center; align-items: center; padding: 84px 16px max(22px, env(safe-area-inset-bottom)); color: #fff; text-align: center; animation: titleIn 1.6s ease both; pointer-events: none; }
.title-ui > * { pointer-events: auto; }
@keyframes titleIn { from { opacity: 0; transform: translateY(14px); } }
.title-brand { display: grid; justify-items: center; gap: 2px; filter: drop-shadow(0 4px 24px rgba(0, 0, 0, .35)); align-self: center; }
.gz-logo { width: min(560px, 86vw); height: auto; overflow: visible; }
.gz-logo text { font-family: var(--serif); font-weight: 700; font-size: 128px; letter-spacing: .06em; fill: #FFFDF6; stroke: #FFFDF6; stroke-width: 1.2; }
.gz-seal rect { fill: var(--seal); }
.gz-seal text { font-family: var(--serif); font-size: 30px; font-weight: 700; fill: #FFF1E2; stroke: none; letter-spacing: 0; }
.title-tag { font-family: var(--serif); font-size: clamp(1.05rem, 2.4vw, 1.35rem); letter-spacing: .5em; margin: 0; padding-left: .5em; opacity: .95; }
.title-actions { display: grid; justify-items: center; gap: 10px; width: min(420px, 100%); margin-bottom: 18px; }
.title-who { margin: 0; font-family: var(--serif); font-size: 1.05rem; text-shadow: 0 1px 10px rgba(0, 0, 0, .5); min-height: 1.4em; }
.title-actions .btn.big { min-width: 240px; min-height: 56px; border-radius: 999px; font-size: 1.1rem; letter-spacing: .08em; }
.title-sub { justify-content: center; gap: 6px; font-size: .95rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.title-sub .dot { opacity: .7; }
.title-auth { width: 100%; text-align: left; padding: 18px; }
.title-auth input { background: rgba(255, 255, 255, .92); color: #1F2A26; border-color: rgba(31, 42, 38, .2); }
.title-auth .hint { color: inherit; opacity: .8; margin: 0; }
.title-auth .hint a { color: inherit; }
.title-auth .err { color: #9B3B2F; }
.title-auth .menu { border: 0; background: none; cursor: pointer; font-size: 1rem; color: inherit; min-width: 36px; min-height: 36px; border-radius: 8px; }
.title-meta { margin: 0 0 6px; font-size: .88rem; letter-spacing: .04em; opacity: .9; text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.title-links { display: flex; gap: 16px; justify-content: center; font-size: .85rem; }
.title-links a { color: rgba(255, 255, 255, .85); }

/* 첫 방문 먹 글씨 */
.intro-gate { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 18px; background: radial-gradient(ellipse at 50% 40%, #1f2a26 0%, #0b100e 70%); color: #F5EFE2; cursor: pointer; transition: opacity 1.6s ease, filter 1.6s ease; outline: none; }
.intro-gate.out { opacity: 0; filter: blur(6px); pointer-events: none; }
.intro-ink { display: grid; justify-items: center; }
.intro-gate .gz-logo text { fill: transparent; stroke: #F5EFE2; stroke-width: 1.6; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: inkStroke 2.6s ease forwards, inkFill 1.2s ease 2.2s forwards; }
.intro-gate .gz-seal { opacity: 0; transform-box: fill-box; transform-origin: center; animation: sealIn .5s cubic-bezier(.2, 1.6, .4, 1) 3.1s forwards; }
@keyframes inkStroke { to { stroke-dashoffset: 0; } }
@keyframes inkFill { to { fill: #F5EFE2; } }
@keyframes sealIn { from { opacity: 0; transform: scale(1.6) rotate(-14deg); } to { opacity: 1; transform: scale(1) rotate(-4deg); } }
.intro-tag { font-family: var(--serif); letter-spacing: .5em; padding-left: .5em; opacity: 0; animation: fadeUp 1.2s ease 3.4s forwards; margin: 0; }
.intro-tap { margin: 28px 0 0; letter-spacing: .2em; opacity: 0; animation: fadeUp 1s ease 4.2s forwards, breathe 3.2s ease-in-out 5.2s infinite; }
.intro-hint { margin: 0; font-size: .82rem; opacity: 0; animation: fadeUp 1s ease 4.6s forwards; color: rgba(245, 239, 226, .65); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { opacity: .45; } }

/* 3D HUD */
.hud-zone { padding: 10px 14px; display: grid; gap: 6px; background: rgba(14, 20, 18, .42); color: #fff; border-color: rgba(255, 255, 255, .25); max-width: min(360px, calc(100vw - 24px)); }
.hud-zone .zone-name { font-family: var(--serif); font-size: 1.2rem; letter-spacing: .04em; }
.hud-zone .chip { min-height: 26px; font-size: .78rem; background: rgba(255, 255, 255, .1); }
.hud-tools { gap: 6px; }
.zone-banner { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 0); z-index: 4; display: grid; justify-items: center; gap: 8px; color: #fff; text-align: center; pointer-events: none; opacity: 0; text-shadow: 0 2px 18px rgba(0, 0, 0, .45); white-space: nowrap; }
.zone-banner.show { animation: banner 4.6s ease forwards; }
.zone-banner .zb-name { font-family: var(--serif); font-weight: 700; font-size: clamp(1.8rem, 5vw, 3rem); letter-spacing: .3em; padding-left: .3em; }
.zone-banner .zb-name::after { content: ""; display: block; height: 2px; margin: 8px auto 0; width: 0; background: linear-gradient(90deg, transparent, rgba(255, 245, 225, .9), transparent); animation: brush 1.4s ease .5s forwards; }
.zone-banner .zb-line { font-family: var(--serif); font-size: clamp(.95rem, 2.2vw, 1.15rem); letter-spacing: .2em; opacity: .95; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 10px); } 14% { opacity: 1; transform: translate(-50%, 0); } 78% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -6px); } }
@keyframes brush { to { width: 100%; } }
.world-actions { gap: 10px; }
.world-actions .act { position: relative; display: grid; justify-items: center; gap: 2px; min-width: 64px; min-height: 64px; padding: 8px 10px 6px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .45); background: rgba(250, 247, 240, .82); color: #1F2A26; cursor: pointer; backdrop-filter: blur(12px); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); font: inherit; }
.world-actions .act:hover { transform: translateY(-1px); background: #fff; }
.world-actions .act-ico { font-size: 1.25rem; line-height: 1; }
.world-actions .act-label { font-size: .82rem; font-weight: 600; }
.world-actions .act .kbd { position: absolute; top: -6px; right: -4px; font-size: .62rem; padding: 0 4px; background: rgba(255, 255, 255, .95); }
.world-tag { background: rgba(14, 20, 18, .55); backdrop-filter: blur(6px); }
.world-tag.portal { background: rgba(246, 213, 142, .95); box-shadow: 0 4px 14px rgba(199, 140, 50, .35); }
.world-status { font-family: var(--serif); letter-spacing: .1em; }
.world-prompt .btn { border-radius: 999px; min-height: 48px; padding: 0 22px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg .btn.on { background: var(--pine); color: #fff; border-color: var(--pine); }
.mixer { display: grid; gap: 8px; }
.mix-row { display: grid; grid-template-columns: 6.5em 1fr; align-items: center; gap: 10px; margin: 0; }
.mix-row input { width: 100%; accent-color: var(--pine); }
dialog h3 { margin: 14px 0 6px; font-size: 1rem; }
@media (max-width: 640px) {
  .hud-zone .zone-name { font-size: 1.02rem; }
  .world-actions .act { min-width: 56px; min-height: 56px; }
  .hud-tools .sky-chip { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
  .title-actions .btn.big { min-width: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-gate .gz-logo text { stroke-dashoffset: 0; fill: #F5EFE2; }
  .intro-gate .gz-seal, .intro-tag, .intro-tap, .intro-hint { opacity: 1; }
}

/* ═══════════ 3D 사찰 지도(지도 페이지·3D 산사 안의 지도) ═══════════ */
.map-page { position: relative; height: 100vh; height: 100dvh; overflow: hidden; background: #0d1412; touch-action: none; }
.world-map-layer { position: absolute; inset: 0; z-index: 8; background: #0d1412; animation: mapIn .35s ease; touch-action: none; }
@keyframes mapIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }
.map-stage { position: absolute; inset: 0; z-index: 0; }
.map-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-labels { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; } /* 이름표끼리만 앞뒤를 다툰다(안내 카드 위로 올라오지 않게) */
.map-pin { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; min-height: 30px; border-radius: 999px; border: 1px solid rgba(255, 240, 210, .55); background: rgba(20, 26, 23, .62); color: #FFF8EA; font: 600 .82rem/1.2 var(--serif); letter-spacing: .04em; white-space: nowrap; cursor: pointer; backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); transition: background .2s, box-shadow .2s; will-change: transform; }
.map-pin::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 2px; height: 6px; background: rgba(255, 240, 210, .6); transform: translateX(-50%); }
.map-pin .mp-count { font: 500 .74rem/1 var(--sans); opacity: .85; padding: 2px 6px; border-radius: 99px; background: rgba(255, 255, 255, .14); }
.map-pin .mp-here { font: 700 .68rem/1 var(--sans); padding: 3px 6px; border-radius: 99px; background: var(--seal); color: #fff; letter-spacing: 0; }
.map-pin.hover, .map-pin:hover, .map-pin:focus-visible { background: rgba(246, 213, 142, .95); color: #2B2416; border-color: #fff; }
.map-pin.on { background: #F6D58E; color: #2B2416; border-color: #fff; box-shadow: 0 0 0 4px rgba(246, 213, 142, .35), 0 8px 22px rgba(0, 0, 0, .3); }
.map-pin.hover .mp-count, .map-pin.on .mp-count, .map-pin:hover .mp-count { background: rgba(43, 36, 22, .12); }
.map-head { position: absolute; left: 16px; top: 76px; width: min(380px, calc(100% - 32px)); padding: 14px 16px; z-index: 3; color: #fff; background: rgba(14, 20, 18, .5); border-color: rgba(255, 255, 255, .22); }
.map-title { font-size: 1.35rem; margin: 0; letter-spacing: .12em; }
.map-sum { margin: 4px 0 0; font-size: .88rem; opacity: .92; }
.map-hint { margin: 6px 0 0; opacity: .75; }
.map-close { border: 0; background: rgba(255, 255, 255, .12); color: inherit; min-width: 40px; min-height: 40px; border-radius: 12px; cursor: pointer; font-size: 1rem; }
.map-panel { position: absolute; right: 16px; top: 76px; width: min(360px, calc(100% - 32px)); max-height: calc(100% - 96px); overflow: auto; padding: 16px; z-index: 3; display: grid; gap: 8px; align-content: start; }
.map-panel .meter { margin: 2px 0 4px; }
.map-panel-eyebrow { font-family: var(--serif); font-size: 1.15rem; margin: 0; }
.map-zone-title { margin: 0; font-size: 1.4rem; letter-spacing: .08em; }
.map-zone-line { font-family: var(--serif); margin: 0; letter-spacing: .06em; }
.map-sub { margin: 6px 0 0; font-size: .95rem; }
.muted-on-glass { opacity: .78; margin: 0; }
.map-panel .chip { color: inherit; border-color: rgba(120, 100, 60, .35); background: rgba(242, 199, 123, .25); }
.map-fallback { position: absolute; inset: 0; display: flex; flex-wrap: wrap; gap: 8px; align-content: center; justify-content: center; padding: 160px 16px 16px; }
.map-fallback .map-pin { position: static; }
@media (max-width: 1100px) and (min-width: 761px) {
  .map-head, .map-panel { width: 300px; }
  .map-hint { display: none; }
}
@media (max-width: 760px) {
  .map-head { top: 66px; left: 10px; width: calc(100% - 20px); padding: 10px 12px; }
  .map-hint { display: none; }
  .map-panel { top: auto; right: 10px; left: 10px; bottom: max(10px, env(safe-area-inset-bottom)); width: auto; max-height: 46%; padding: 12px 14px; }
  .map-pin { font-size: .76rem; padding: 3px 8px 3px 6px; min-height: 28px; }
}

/* ═══════════ 장터·옷장(아이템 썸네일·입어 보기·3D 미리보기) ═══════════ */
.wallet-card { padding: 12px 16px; min-width: 200px; }
.wallet-card p { margin: 2px 0 0; }
.cat-nav { margin: 4px 0 14px; }
.shop-layout { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }
.tryon { position: sticky; top: 84px; display: grid; gap: 8px; padding: 12px; }
.tryon .preview3d { height: min(52vh, 380px); }
.tryon-caption { margin: 0; color: var(--ink-2); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr)); gap: 12px; }
.item { display: grid; gap: 4px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); align-content: start; box-shadow: var(--shadow); min-width: 0; }
.item-thumb { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--tint, #ccc) 26%, #fffdf8), color-mix(in srgb, var(--tint, #ccc) 12%, var(--hanji))); }
.item-thumb img { width: 88%; height: 88%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(40, 32, 24, .18)); transition: transform .25s; }
.item:hover .item-thumb img { transform: translateY(-2px) scale(1.03); }
.item-title { font-size: 1rem; margin: 4px 0 0; }
.item-desc { margin: 0; }
.item-meta { margin: 0; font-size: .78rem; color: var(--ink-3); }
.item-why { margin: 0; font-size: .78rem; color: var(--brass-text); }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.item-actions .btn[aria-pressed="true"] { background: var(--mist); border-color: var(--pine); }
.pill.ok { outline: none; }
.wardrobe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.preview-card { position: sticky; top: 84px; display: grid; gap: 10px; }
.preview3d { height: min(58vh, 480px); border-radius: var(--radius); overflow: hidden; background: radial-gradient(ellipse at 50% 30%, #F2F5EE, #DFE8E1 55%, #E9E2D3); cursor: grab; }
.preview3d:active { cursor: grabbing; }
.preview3d canvas { width: 100%; height: 100%; display: block; }
.preview-tools { justify-content: center; }
.preview-tools .btn[aria-pressed="true"] { background: var(--pine); color: #fff; border-color: var(--pine); }
.wardrobe-controls h2 { font-size: 1.02rem; margin: 16px 0 8px; }
.wardrobe-controls h2:first-child { margin-top: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.tile { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 8px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); cursor: pointer; color: var(--ink); min-height: 96px; }
.tile:hover { border-color: var(--pine); }
.tile img { width: 56px; height: 56px; object-fit: contain; }
.tile-none { width: 56px; height: 56px; display: grid; place-items: center; color: var(--ink-3); font-size: 1.4rem; }
.tile-label { font-size: .8rem; line-height: 1.25; text-align: center; }
.tile[aria-pressed="true"] { border-color: var(--pine); box-shadow: inset 0 0 0 2px var(--pine); background: color-mix(in srgb, var(--pine) 9%, var(--paper)); }
.save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 14px 0 max(14px, env(safe-area-inset-bottom)); margin-top: 12px; background: linear-gradient(to bottom, transparent, var(--hanji) 35%); }
.save-status { margin: 0 auto 0 0; color: var(--brass-text); }
@media (max-width: 860px) {
  .shop-layout, .wardrobe { grid-template-columns: 1fr; }
  .tryon, .preview-card { position: static; }
  .tryon .preview3d { height: 240px; }
  .preview3d { height: 300px; }
}
@media (max-width: 520px) { .wallet-card { min-width: 0; width: 100%; } }

/* 첫 화면: 가입 버튼·둘러보기·입력 칸 */
.btn.ghost-light { min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .55); background: rgba(14, 20, 18, .32); color: #fff; backdrop-filter: blur(8px); cursor: pointer; letter-spacing: .04em; }
.btn.ghost-light:hover { background: rgba(14, 20, 18, .5); }
.title-sub span:not(.dot) { opacity: .85; }
.title-field { display: block; }
.title-field input { width: 100%; }
