/* ========== 디자인 토큰 ========== */
:root {
  color-scheme: light;
  --bg: #f7f5f1; --surface: #ffffff; --surface-2: #f4f1ec; --surface-3: #faf8f5;
  --ink: #1f1b18; --ink-2: #4a433d; --muted: #6f675f; --line: #ebe6de; --line-2: #ddd5c9;
  --accent: #e0653d; --accent-d: #b84b27; --soft: #fcefe8;
  --primary: #1f1b18; --primary-h: #3a332e; --on-primary: #ffffff;
  --ok-bg: #e5f3e9; --ok-ink: #1f5634; --warn-bg: #fdf0e4; --warn-ink: #7a3e14;
  --info-bg: #fff3d6; --info-ink: #6b4d08; --bad-bg: #fde4e0; --bad-ink: #8a2f22; --end-bg: #ece9f5; --end-ink: #4b437a;
  --gold: #b8892c; --silver: #8a939d; --bronze: #a86b3f;
  --glass: rgba(255, 255, 255, .88); --glass-ink: #1f1b18; --overlay: rgba(30, 22, 16, .45);
  --sk: #ebe6de; --sk-hi: #f5f2ed;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(31, 27, 24, .04), 0 8px 28px rgba(31, 27, 24, .06);
  --shadow-h: 0 2px 4px rgba(31, 27, 24, .05), 0 16px 40px rgba(31, 27, 24, .10);
  --tw-a: #f8f6f2; --tw-b: #e9e4dc; --ta-a: #f6e9d3; --ta-b: #dcbd95; --tg-a: #eaf4e1; --tg-b: #bfdea7;
  --tgy-a: #f6f0e5; --tgy-b: #e0d2b8; --tor-a: #efe7da; --tor-b: #cbb896; --tsg-a: #ece5e1; --tsg-b: #c99d90; --tpk-a: #dff1ff; --tpk-b: #b6dcf3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #161311; --surface: #201c19; --surface-2: #2a2522; --surface-3: #25211e;
    --ink: #f3eee8; --ink-2: #d4cbc1; --muted: #a99f94; --line: #312b26; --line-2: #3f3832;
    --accent: #f0825c; --accent-d: #f6a483; --soft: #3a251c;
    --primary: #f3eee8; --primary-h: #ffffff; --on-primary: #161311;
    --ok-bg: #1b3324; --ok-ink: #a9dcb8; --warn-bg: #3a2a1a; --warn-ink: #f2c9a0;
    --info-bg: #3a3118; --info-ink: #f0d78f; --bad-bg: #3d1f1a; --bad-ink: #f3b0a3; --end-bg: #2a2740; --end-ink: #c9c2f0;
    --glass: rgba(32, 28, 25, .88); --glass-ink: #f3eee8; --overlay: rgba(0, 0, 0, .6);
    --sk: #2a2522; --sk-hi: #332d29;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
    --shadow-h: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .4);
    --tw-a: #2d2a27; --tw-b: #201e1c; --ta-a: #3b2d1f; --ta-b: #281e14; --tg-a: #24321f; --tg-b: #182415;
    --tgy-a: #312b23; --tgy-b: #211c16; --tor-a: #2f2820; --tor-b: #1e1912; --tsg-a: #2c2422; --tsg-b: #1a1514; --tpk-a: #1c2a38; --tpk-b: #101a24;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161311; --surface: #201c19; --surface-2: #2a2522; --surface-3: #25211e;
  --ink: #f3eee8; --ink-2: #d4cbc1; --muted: #a99f94; --line: #312b26; --line-2: #3f3832;
  --accent: #f0825c; --accent-d: #f6a483; --soft: #3a251c;
  --primary: #f3eee8; --primary-h: #ffffff; --on-primary: #161311;
  --ok-bg: #1b3324; --ok-ink: #a9dcb8; --warn-bg: #3a2a1a; --warn-ink: #f2c9a0;
  --info-bg: #3a3118; --info-ink: #f0d78f; --bad-bg: #3d1f1a; --bad-ink: #f3b0a3; --end-bg: #2a2740; --end-ink: #c9c2f0;
  --glass: rgba(32, 28, 25, .88); --glass-ink: #f3eee8; --overlay: rgba(0, 0, 0, .6);
  --sk: #2a2522; --sk-hi: #332d29;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .25);
  --shadow-h: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .4);
  --tw-a: #2d2a27; --tw-b: #201e1c; --ta-a: #3b2d1f; --ta-b: #281e14; --tg-a: #24321f; --tg-b: #182415;
    --tgy-a: #312b23; --tgy-b: #211c16; --tor-a: #2f2820; --tor-b: #1e1912; --tsg-a: #2c2422; --tsg-b: #1a1514; --tpk-a: #1c2a38; --tpk-b: #101a24;
}

/* ========== 기본 ========== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: Pretendard, -apple-system, "Apple SD Gothic Neo", system-ui, sans-serif; line-height: 1.55; letter-spacing: -.01em; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; transition: background .2s, color .2s; }
a { color: inherit; }
h1, h2, h3, .m-title { font-family: "Gowun Batang", serif; letter-spacing: -.02em; line-height: 1.3; font-weight: 700; }
h1 { font-size: clamp(26px, 4.4vw, 38px); margin: 0 0 8px; }
img { max-width: 100%; display: block; }
img[onload] { opacity: 0; transition: opacity .35s; }
img.ok { opacity: 1; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--ink); width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); margin-top: 6px; transition: border-color .15s, box-shadow .15s; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: block; font-size: 14px; color: var(--ink-2); font-weight: 500; }
.lbl { font-size: 14px; display: block; margin-bottom: 6px; color: var(--ink-2); font-weight: 500; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); border: 0; padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; }
#app:focus { outline: none; }
.linklike { border: 0; background: none; padding: 0; color: var(--muted); text-decoration: underline; font-size: 12px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ========== 상단 ========== */
#topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 0 24px; height: 64px; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.logo { font-family: "Gowun Batang", serif; font-weight: 700; font-size: 23px; text-decoration: none; display: flex; align-items: baseline; gap: 8px; letter-spacing: -.03em; }
.logo small { font-family: Pretendard, sans-serif; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.tabs { display: flex; gap: 4px; margin-left: auto; height: 100%; }
.tabs a { position: relative; display: flex; align-items: center; padding: 0 14px; text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 600; transition: color .15s; }
.tabs a:hover, .tabs a.on { color: var(--ink); }
.tabs a.on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ink); }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--surface-3); }
.chip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.chip:has(.avatar) { padding: 4px 12px 4px 4px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--soft); color: var(--accent-d); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.avatar.xl { width: 56px; height: 56px; font-size: 22px; font-family: "Gowun Batang", serif; }
#foot { text-align: center; font-size: 12px; color: var(--muted); padding: 40px 16px 48px; }
#foot a { color: var(--ink-2); }
body.in-room #topbar, body.in-room #foot { display: none; }

/* ========== 레이아웃 ========== */
.page { max-width: 1120px; margin: 0 auto; padding: 40px 24px; }
.page.narrow { max-width: 720px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 14px; } .tiny { font-size: 12px; }
.eyebrow { color: var(--accent-d); font-size: 13px; font-weight: 700; margin: 0 0 6px; letter-spacing: .06em; }
.sec { font-size: 21px; margin: 48px 0 16px; }
.sec small { color: var(--muted); font-family: Pretendard, sans-serif; font-size: 15px; font-weight: 500; }
.sec-sm { font-family: Pretendard, sans-serif; font-size: 15px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 6px; letter-spacing: -.01em; }
.sec-sm svg { width: 17px; height: 17px; fill: none; stroke: var(--accent-d); stroke-width: 2; stroke-linecap: round; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.nowrap { white-space: nowrap; }

/* 상태 화면(빈 화면·오류·안내) */
.state { display: grid; justify-items: center; gap: 6px; padding-top: 56px; }
.state p { margin: 0; }
.state .row { margin-top: 18px; }
.state-ill { width: 76px; height: 76px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; place-items: center; font-size: 36px; margin-bottom: 10px; }
.empty.state { padding: 36px 20px; }
.empty.state b { font-size: 17px; }

/* 스켈레톤 */
.sk { background: linear-gradient(90deg, var(--sk) 0%, var(--sk-hi) 50%, var(--sk) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 10px; }
.sk-line { height: 14px; margin-bottom: 12px; } .w30 { width: 30%; } .w60 { width: 60%; }
.sk-title { height: 36px; width: 55%; margin-bottom: 14px; }
.sk-bar { height: 84px; margin: 26px 0; border-radius: var(--radius); }
.sk-card { height: 340px; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ========== 버튼 ========== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 600; transition: transform .1s, background .15s, box-shadow .15s; min-height: 42px; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-h); }
.btn.kakao { background: #fee500; border-color: #fee500; color: #191600; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.lg { padding: 13px 22px; font-size: 16px; min-height: 50px; border-radius: 14px; }
.btn.sm { padding: 6px 12px; font-size: 13px; min-height: 34px; border-radius: 10px; }
.btn.block { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .4; cursor: default; }

/* 세그먼트 */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); color: var(--ink); }
.seg.scroll { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg.scroll::-webkit-scrollbar { display: none; }
.seg.scroll button { flex: none; }

/* ========== 홈 ========== */
.home-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.home-head p.muted { margin: 0; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 28px; }
.summary div { padding: 18px 22px; display: grid; gap: 2px; }
.summary div + div { border-left: 1px solid var(--line); }
.summary b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.summary span { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #2fb36a; display: inline-block; box-shadow: 0 0 0 0 rgba(47, 179, 106, .5); animation: pulse 1.8s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(47, 179, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 179, 106, 0); } }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ok-ink); background: var(--ok-bg); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.live[hidden] { display: none; }
.excover .live { position: absolute; top: 16px; right: 14px; z-index: 1; }
.rmain .live { margin-left: 4px; }

.soon { margin-bottom: 28px; }
.soon-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.soon-card { flex: none; width: 280px; scroll-snap-align: start; display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; transition: box-shadow .2s, transform .2s; }
.soon-card:hover { box-shadow: var(--shadow-h); transform: translateY(-2px); }
.soon-thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; display: block; }
.soon-thumb img { width: 100%; height: 100%; object-fit: cover; }
.soon-txt { display: grid; min-width: 0; }
.soon-txt b { font-family: "Gowun Batang", serif; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soon-txt span { font-size: 12px; color: var(--muted); }
.sample-tag { display: inline-block; font-family: Pretendard, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0; color: var(--ink-2); background: var(--surface-2); border: 1px dashed var(--line-2); padding: 2px 8px; border-radius: 8px; white-space: nowrap; vertical-align: middle; }
.samples { margin-top: 32px; }
.samples .sec-sm { margin-bottom: 4px; }
.samples-note { margin: 0 0 12px; }
.notice.sample { background: var(--surface-2); color: var(--ink-2); border: 1px dashed var(--line-2); }
.dday-pill {font-size: 12px; font-weight: 700; color: var(--bad-ink); background: var(--bad-bg); padding: 4px 9px; border-radius: 8px; white-space: nowrap; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.podium { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.podium > li { display: flex; }
.excard { flex: 1; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; }
.excard:hover { transform: translateY(-4px); box-shadow: var(--shadow-h); }
.excover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.excover img { position: absolute; inset: 0; margin: auto; max-height: calc(100% - 64px); max-width: calc(100% - 96px); box-shadow: 0 0 0 7px #fff, 0 0 0 9px rgba(31, 27, 24, .85), 0 14px 26px rgba(0, 0, 0, .22); transition: transform .3s, opacity .35s; }
.excard:hover .excover img { transform: scale(1.03); }
.rank { position: absolute; top: 14px; left: 14px; z-index: 1; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; background: #1f1b18; box-shadow: 0 4px 10px rgba(0, 0, 0, .15); }
.rank.r1 { background: var(--gold); } .rank.r2 { background: var(--silver); } .rank.r3 { background: var(--bronze); }
.exinfo { padding: 16px 18px 18px; display: grid; gap: 4px; }
.exmeta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 500; }
.dday { color: var(--accent-d); font-weight: 700; }
.extitle { font-family: "Gowun Batang", serif; font-size: 19px; font-weight: 700; line-height: 1.35; }
.exartist { font-size: 14px; color: var(--ink-2); }
.exstats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.st { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-2); background: var(--surface-2); padding: 4px 9px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.st svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.st i { font-style: normal; font-size: 12px; color: var(--muted); }
.st.hl { background: var(--soft); color: var(--accent-d); }
.st.hl i { color: var(--accent-d); }
.rank-list { list-style: none; padding: 0; margin: 18px 0 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.rank-list > li + li { border-top: 1px solid var(--line); }
.rrow { display: grid; grid-template-columns: 32px 56px 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; text-decoration: none; transition: background .15s; }
.rrow:hover { background: var(--surface-3); }
.rnum { font-weight: 800; font-size: 16px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.rrow img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.rmain { display: grid; min-width: 0; }
.rmain b { font-family: "Gowun Batang", serif; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmain > span { font-size: 13px; color: var(--muted); }
.rrow .exstats { margin: 0; flex-wrap: nowrap; }
.t-white { background: linear-gradient(160deg, var(--tw-a), var(--tw-b)); }
.t-attic { background: linear-gradient(160deg, var(--ta-a), var(--ta-b)); }
.t-garden { background: linear-gradient(160deg, var(--tg-a), var(--tg-b)); }
.t-getty { background: linear-gradient(160deg, var(--tgy-a), var(--tgy-b)); }
.t-orsay { background: linear-gradient(160deg, var(--tor-a), var(--tor-b)); }
.t-seongsu { background: linear-gradient(160deg, var(--tsg-a), var(--tsg-b)); }
.t-park { background: linear-gradient(180deg, var(--tpk-a), var(--tpk-b)); }
.open-cta { margin-top: 56px; display: grid; grid-template-columns: 1fr 1.3fr; gap: 28px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px; box-shadow: var(--shadow); }
.open-cta h2 { font-size: 24px; margin: 0 0 6px; }
.steps { list-style: none; padding: 0; margin: 18px 0 22px; display: grid; gap: 8px; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--soft); color: var(--accent-d); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.themes-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.themes-mini figure { margin: 0; border-radius: 14px; padding: 8px 8px 10px; }
.themes-mini canvas { width: 100%; aspect-ratio: 1; display: block; }
.themes-mini figcaption { text-align: center; font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* ========== 로그인·운영 잠금 ========== */
.login-card { max-width: 420px; margin: 24px auto 0; text-align: left; }

/* ========== 만들기 ========== */
.create .step { margin-top: 20px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.step h2 { font-size: 19px; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.step h2 i { font-style: normal; font-family: Pretendard, sans-serif; font-weight: 700; width: 26px; height: 26px; border-radius: 8px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-size: 13px; }
.step h2 small { margin-left: auto; color: var(--muted); font-family: Pretendard, sans-serif; font-weight: 600; font-size: 14px; }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tp input { position: absolute; opacity: 0; }
.tp span { display: grid; gap: 2px; padding: 8px 8px 12px; border: 2px solid transparent; border-radius: 14px; cursor: pointer; text-align: center; font-size: 14px; box-shadow: inset 0 0 0 1px var(--line); transition: border-color .15s; }
.tp small { font-size: 12px; color: var(--muted); }
.tp canvas { aspect-ratio: 4 / 3; height: auto; width: 100%; display: block; border-radius: 8px; }
.tp input:checked + span { border-color: var(--ink); }
.tp input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop { display: grid; place-items: center; gap: 4px; text-align: center; padding: 28px; border: 1.5px dashed var(--line-2); border-radius: 14px; cursor: pointer; background: var(--surface-3); transition: border-color .15s, background .15s; }
.drop:hover, .drop:focus-within { border-color: var(--ink); background: var(--surface-2); }
.drop[hidden] { display: none; }
.drop.busy { opacity: .6; pointer-events: none; }
.drop-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-size: 22px; margin-bottom: 4px; }
.drop.small { padding: 16px; }
.drop.small img { max-height: 160px; border-radius: 8px; }
.works { display: grid; gap: 10px; margin-top: 12px; }
.work { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.work img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.wf { display: grid; gap: 4px; }
.wf input { margin: 0; padding: 7px 10px; font-size: 14px; }
.wbtn { display: grid; gap: 4px; }
.wbtn button { width: 32px; height: 28px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; }
.wbtn button:disabled { opacity: .3; }
.bulk { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.bulk[hidden] { display: none; }
.bulk input { margin: 0; }
.proof { margin: 12px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-top: 10px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.submit-bar { position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; padding: 16px 0; margin-top: 20px; background: linear-gradient(transparent, var(--bg) 35%); }
.notice { padding: 12px 16px; border-radius: 12px; margin: 12px 0; font-size: 15px; }
.notice.ok { background: var(--ok-bg); color: var(--ok-ink); }
.notice.warn { background: var(--warn-bg); color: var(--warn-ink); }
.notice a { font-weight: 600; }
.warn-t { color: var(--warn-ink); }

/* ========== 리스트 ========== */
.list { display: grid; gap: 10px; }
.lrow { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }
.lrow img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.lmain { display: grid; gap: 2px; justify-items: start; min-width: 0; }
.lhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lmain b { font-family: "Gowun Batang", serif; font-size: 16px; }
.lmain .exstats { margin-top: 6px; }
.lact { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.b-approved { background: var(--ok-bg); color: var(--ok-ink); } .b-pending { background: var(--info-bg); color: var(--info-ink); }
.b-rejected, .b-hidden { background: var(--bad-bg); color: var(--bad-ink); } .b-ended { background: var(--end-bg); color: var(--end-ink); }
.empty { text-align: center; }

/* ========== 공유 ========== */
.sharecard { width: min(100%, 380px); height: auto; border-radius: 18px; box-shadow: var(--shadow-h); margin: 24px auto; display: block; }
.copyrow { display: flex; gap: 8px; max-width: 480px; margin: 0 auto; }
.copyrow input { margin: 0; }
.copyrow .btn { flex: none; }

/* ========== 운영 ========== */
.review { margin-bottom: 14px; }
.rv-title { font-family: "Gowun Batang", serif; font-size: 18px; }
.rv-works { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0; }
.rv-works figure { margin: 0; width: 120px; flex: none; font-size: 12px; color: var(--ink-2); }
.rv-works img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; margin-bottom: 4px; }
.rv-proof { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.proofimg { max-height: 80px; display: inline-block; vertical-align: middle; border-radius: 6px; }
.table-wrap { position: relative; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { font-weight: 600; color: var(--muted); font-size: 12px; white-space: nowrap; background: var(--surface-3); }
tbody th { font-weight: 600; }
.settings { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.settings label { flex: 1; min-width: 180px; }

/* ========== 지난 전시 ========== */
.ended-head { padding: 20px 0; }
.ended-stats .exstats { justify-content: center; margin: 14px 0 6px; }
.grid-works { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gw { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px; display: grid; gap: 6px; font-size: 13px; text-align: left; color: var(--ink); }
.gw img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.gw:hover { box-shadow: var(--shadow); }
.gb-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.gb-list li { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; font-size: 15px; position: relative; padding-right: 56px; }
.gb-list li b { margin-right: 6px; }
.gb-list .x { position: absolute; right: 8px; top: 8px; border: 0; background: transparent; color: var(--bad-ink); font-size: 12px; }
.exit-ill { font-size: 48px; margin: 8px 0 4px; }

/* ========== 전시 포스터(입장 전) ========== */
.poster { min-height: calc(100dvh - 64px); display: grid; place-items: center; padding: 40px 24px; }
.poster-inner { width: min(1040px, 100%); display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.poster-art { margin: 0; display: grid; justify-items: center; gap: 14px; }
.poster-art img { max-height: 62vh; width: auto; max-width: 100%; box-shadow: 0 0 0 10px #fff, 0 0 0 13px #1f1b18, 0 30px 60px rgba(0, 0, 0, .28); }
.poster-art figcaption { font-size: 13px; color: var(--ink-2); margin-top: 14px; }
.poster-info { background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 24px; padding: 30px; box-shadow: var(--shadow-h); }
.poster-title { font-size: clamp(30px, 4.6vw, 46px); margin: 0 0 8px; }
.poster-dates { font-size: 14px; color: var(--ink-2); margin: 0 0 14px; }
.poster-dates b { color: var(--accent-d); }
.poster-intro { font-family: "Gowun Batang", serif; font-size: 16px; line-height: 1.7; color: var(--ink-2); margin: 0 0 16px; }
.poster-strip { display: flex; gap: 6px; margin-bottom: 14px; }
.poster-strip img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.poster-strip .more { width: 52px; height: 52px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.poster-meta { display: grid; gap: 8px; margin-bottom: 16px; }
.poster-meta .exstats { margin: 0; }
.live-line { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ok-ink); }
.entry-form { border-top: 1px solid var(--line); padding-top: 16px; }
.entry-form label { margin-bottom: 12px; }
/* 관람 캐릭터 만들기 */
.cb { display: grid; gap: 4px; margin-bottom: 6px; }
.cb .lbl { margin: 12px 0 8px; }
.cb .lbl small { font-weight: 400; }
.cb label { margin-bottom: 0; }
.cb-hero { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; padding: 12px; border-radius: 18px; background: radial-gradient(circle at 30% 30%, var(--surface), var(--surface-2)); border: 1px solid var(--line); margin-bottom: 8px; }
.cb-cv { width: 132px; height: 112px; display: block; }
.cb-id { display: grid; gap: 4px; justify-items: start; }
.cb-id .eyebrow { margin: 0; }
.cb-id b { font-family: "Gowun Batang", serif; font-size: 19px; line-height: 1.3; }
.cb-id .btn { margin-top: 4px; }
.cb-id .row { gap: 6px; flex-wrap: wrap; }
.cb-quote { font-family: "Gowun Batang", serif; font-size: 14px; color: var(--ink-2); }
.cb-dex { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.cb-opt { cursor: pointer; }
.cb-tastes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cb-tastes .cb-opt { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; transition: border-color .15s, transform .15s; }
.cb-tastes em { font-style: normal; font-size: 22px; line-height: 1.1; }
.cb-tastes .cb-opt[aria-checked="true"] { border: 2px solid var(--ink); padding: 9px 3px; background: var(--surface-3); }
.cb-tastes .cb-opt:hover { transform: translateY(-1px); }
.cb-species { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cb-species small { font-size: 10.5px; font-weight: 500; color: var(--muted); margin-top: -2px; }
.cb-species .cb-opt { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; }
.cb-species canvas { width: 48px; height: 46px; display: block; }
.cb-species .cb-opt[aria-checked="true"] { border: 2px solid var(--ink); padding: 5px 1px 7px; background: var(--surface-3); }
.cb-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.cb-pal { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-pal .sw { width: 30px; height: 30px; }
.cb-face { flex-wrap: nowrap; }
.cb-face .cb-opt[aria-checked="true"] { background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); color: var(--ink); }
.swatches { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.sw { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line-2); }
.sw[aria-checked="true"] { box-shadow: 0 0 0 2px var(--ink); }
.cb-pal .sw { position: relative; }
.cb-pal .sw.orig::after { content: '★'; position: absolute; top: -7px; right: -6px; font-size: 11px; color: #e8734a; text-shadow: 0 0 2px var(--surface); }

/* ========== 전시관 ========== */
.room { position: fixed; inset: 0; display: flex; flex-direction: column; height: 100dvh; }
.room-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
.room-title { flex: 1; min-width: 0; text-align: center; display: grid; }
.room-title b { font-family: "Gowun Batang", serif; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-title span { font-size: 12px; color: var(--ink-2); }
.room-meta { display: flex; gap: 6px; align-items: center; }
.pill { font-size: 12px; font-weight: 600; background: var(--glass); color: var(--glass-ink); padding: 6px 11px; border-radius: 99px; white-space: nowrap; }
.rbtn { border: 0; background: var(--glass); color: var(--glass-ink); padding: 9px 14px; border-radius: 99px; font-size: 14px; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); white-space: nowrap; min-height: 40px; }
.rbtn:active { transform: scale(.96); }
.rbtn.accent { background: var(--accent); color: #fff; }
.preview-bar { background: var(--info-bg); color: var(--info-ink); font-size: 13px; text-align: center; padding: 6px 12px; }
.stage-wrap { flex: 1; position: relative; min-height: 0; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.zoom { position: absolute; right: 12px; bottom: 14px; display: grid; background: var(--glass); border-radius: 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .1); overflow: hidden; z-index: 2; }
.zoom button { width: 40px; height: 40px; border: 0; background: transparent; color: var(--glass-ink); font-size: 18px; }
.zoom button + button { border-top: 1px solid var(--line); }
.art-keys { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 3; }
.art-keys button { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
.art-keys button:focus { position: static; width: auto; height: auto; clip: auto; display: block; background: #1f1b18; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.art-keys small { opacity: .7; margin-left: 6px; font-weight: 400; }
.hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(31, 27, 24, .82); color: #fff; font-size: 13px; padding: 7px 14px; border-radius: 99px; white-space: nowrap; transition: opacity .8s; pointer-events: none; max-width: calc(100% - 90px); overflow: hidden; text-overflow: ellipsis; }
.hint.fade { opacity: 0; }
.room-bottom { padding: 8px 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center; }
.react-wrap { display: grid; gap: 4px; justify-items: center; max-width: 100%; }
.react-target { margin: 0; font-size: 12px; color: var(--muted); text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.react-target b { color: var(--ink); font-weight: 600; }
.emoji-bar { display: flex; gap: 2px; background: var(--glass); padding: 4px 6px; border-radius: 18px; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); max-width: 100%; }
/* 감정 버튼: 이모지 + 감정 이름 + 개수 배지 */
.rx { position: relative; border: 0; background: transparent; color: var(--ink); display: grid; justify-items: center; gap: 1px; min-width: 54px; padding: 5px 4px 4px; border-radius: 12px; transition: transform .15s, background .15s; }
.rx-e { font-size: 21px; line-height: 1.1; }
.rx-l { font-size: 10.5px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; opacity: .8; }
.rx-c { position: absolute; top: 0; left: calc(50% + 7px); min-width: 18px; padding: 0 5px; height: 16px; border-radius: 9px; background: var(--ink); color: var(--bg); font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.rx-c:empty { display: none; }
.rx:hover { background: rgba(127, 127, 127, .12); }
.rx[aria-pressed="true"] { background: rgba(232, 115, 74, .16); box-shadow: inset 0 0 0 1.5px #e8734a; }
.rx[aria-pressed="true"] .rx-l { color: #e8734a; opacity: 1; }
.rx[aria-pressed="true"] .rx-c { background: #e8734a; color: #fff; }
.rx.idle { opacity: .55; }
.rx.pop { transform: scale(1.18); }
.gw-rx { font-size: 12px; letter-spacing: .02em; }
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* ========== 모달 ========== */
.modal-back { position: fixed; inset: 0; z-index: 50; background: var(--overlay); display: grid; place-items: center; padding: 16px; animation: fade .18s; }
.modal { background: var(--surface); color: var(--ink); border-radius: 22px; padding: 24px; width: min(460px, 100%); max-height: 88dvh; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: up .22s ease-out; }
.modal:focus { outline: none; }
.modal h3 { margin: 0 0 10px; font-size: 20px; }
.modal label { margin: 12px 0; }
.artist { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.artist > div { display: grid; }
.artist .eyebrow { margin: 0; }
.artist-name { font-family: "Gowun Batang", serif; font-size: 20px; }
.info-title { margin-top: 6px !important; }
.info-intro { font-family: "Gowun Batang", serif; color: var(--ink-2); line-height: 1.7; margin: 0 0 10px; }
.gift-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.gift-pick label { margin: 0; }
.gift-pick input { position: absolute; opacity: 0; }
.gift-pick span { display: grid; justify-items: center; gap: 2px; padding: 14px; border: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--line); border-radius: 14px; cursor: pointer; color: var(--ink); }
.gift-pick em { font-style: normal; font-size: 34px; }
.gift-pick small { color: var(--muted); font-size: 12px; }
.gift-pick input:checked + span { border-color: var(--ink); }
.gift-pick input:focus-visible + span { outline: 2px solid var(--accent); }
.gb-form { display: flex; gap: 8px; }
.gb-form input { margin: 0; }
.gb-form + .tiny { text-align: right; margin: 4px 0 12px; }
.menu { display: grid; gap: 8px; margin-top: 16px; }
.menu button, .menu a { text-align: left; padding: 13px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.menu button:hover, .menu a:hover { background: var(--surface-3); }
.menu .danger { color: var(--bad-ink); }
.cta-box { background: var(--soft); border-radius: 16px; padding: 18px; display: grid; gap: 4px; margin: 16px 0 6px; }
.cta-box b { font-family: "Gowun Batang", serif; font-size: 18px; }
.cta-box span { font-size: 14px; color: var(--ink-2); }

/* 작품 크게 보기: 무대(작품) / 캡션 / 하단 버튼, 오른쪽에 감상 도구 */
.lightbox { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; background: #1a1715; color: #fff; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: 10px; position: relative; padding: 60px 72px 18px; overflow: hidden; transition: background .45s, padding .25s; }
.lightbox[data-light="spot"] { background: radial-gradient(ellipse 55% 75% at 50% -5%, #4a3d30 0%, #0c0a09 72%); }
.lightbox[data-light="warm"] { background: radial-gradient(ellipse 80% 80% at 50% 35%, #3d2817 0%, #120b07 75%); }
.lightbox[data-light="window"] { background: linear-gradient(100deg, #45433d 0%, #1c1d20 55%, #0d0e11 100%); }
.lightbox[data-light="cloudy"] { background: linear-gradient(#2a3039, #14171c); }
.lightbox[data-light="dim"] { background: #050404; }
.modal-back:has(.lightbox) { padding: 0; }
.lb-stage { position: relative; min-height: 0; min-width: 0; touch-action: none; user-select: none; }
.lb-tilt { position: absolute; inset: 0; display: grid; place-items: center; perspective: 1300px; }
.lb-art { position: relative; overflow: hidden; background: #fff; padding: 10px; outline: 3px solid #1f1b18; cursor: grab; transition: transform .28s cubic-bezier(.2, .7, .3, 1), box-shadow .28s; will-change: transform; box-shadow: 0 24px 50px rgba(0, 0, 0, .5); }
.lb-art.dragging { transition: none; cursor: grabbing; }
.lb-img { display: block; max-height: calc(100dvh - 250px); max-width: calc(100vw - 184px); object-fit: contain; transition: filter .35s; pointer-events: none; }
/* 빛 레이어는 작품보다 크게 깔고(회전해도 빈틈 없게) 작품 밖은 잘라낸다 */
.lb-light, .lb-glare { position: absolute; inset: -30%; pointer-events: none; transition: opacity .35s, transform .28s cubic-bezier(.2, .7, .3, 1); }
.lb-glare { background: linear-gradient(115deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0) 62%); background-size: 260% 260%; mix-blend-mode: soft-light; opacity: 0; }
.lb-cap { display: grid; gap: 2px; text-align: center; }
.lb-cap b { font-family: "Gowun Batang", serif; font-size: 20px; }
.lb-cap small { font-size: 12px; color: #c9c0b6; }
.lb-close { position: absolute; z-index: 2; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 18px; }
/* 무대(그림 영역)가 뒤에 그려져 화살표를 덮지 않도록 위로 올린다 */
.lb-nav { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); width: 46px; height: 64px; border: 0; background: rgba(255, 255, 255, .12); color: #fff; font-size: 34px; border-radius: 12px; }
.lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; transition: right .25s; }
.tools-open .lb-nav.next { right: 332px; }
.tools-open .lb-close { right: 332px; }
.lb-bottom { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }
.lb-emo { display: flex; gap: 4px; background: rgba(255, 255, 255, .1); padding: 4px; border-radius: 16px; max-width: 100%; }
.lb-emo .rx { color: #fff; }
.lb-emo .rx-c { background: #fff; color: #1f1b18; }
.lb-emo .rx:hover { background: rgba(255, 255, 255, .14); }
.lb-emo .rx[aria-pressed="true"] { background: rgba(232, 115, 74, .3); }
.lb-emo .rx[aria-pressed="true"] .rx-l { color: #ffb08f; }
.lb-tools-btn { display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 16px; border: 0; border-radius: 99px; background: rgba(255, 255, 255, .14); color: #fff; font-size: 14px; font-weight: 600; }
.lb-tools-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.lb-tools-btn[aria-expanded="true"] { background: #fff; color: #1f1b18; }

/* 감상 도구 패널 */
/* 감상 도구는 그림 위에 겹쳐 열린다: 그림 위치와 크기는 그대로 둔다 */
.lb-tools { display: none; position: absolute; z-index: 3; top: 16px; right: 16px; bottom: 16px; width: 304px; overflow: auto; padding: 18px; border-radius: 18px; background: rgba(30, 26, 23, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255, 255, 255, .08); color: #f3eee8; scrollbar-width: thin; }
.tools-open .lb-tools { display: block; animation: fade .2s; }
.lbt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.lbt-head b { font-size: 16px; }
.lbt-reset { border: 0; background: none; color: #c9c0b6; font-size: 13px; text-decoration: underline; padding: 4px; }
.lb-tools section { padding: 14px 0; border-top: 1px solid rgba(255, 255, 255, .08); }
.lb-tools section:first-of-type { border-top: 0; }
.lb-tools h4 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: #c9c0b6; letter-spacing: .04em; }
.lt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.lt-grid button, .ang-chips button, .rot-row button { display: flex; align-items: center; gap: 8px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: #f3eee8; border-radius: 10px; padding: 9px 10px; font-size: 13px; font-weight: 600; text-align: left; transition: background .15s, border-color .15s; }
.lt-grid button:hover, .ang-chips button:hover, .rot-row button:hover { background: rgba(255, 255, 255, .1); }
.lt-grid button[aria-checked="true"], .ang-chips button.on { border-color: #fff; background: rgba(255, 255, 255, .16); }
.lt-grid i { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.sw-natural { background: linear-gradient(135deg, #fbf8f2, #d9d3c8); }
.sw-spot { background: radial-gradient(circle at 50% 20%, #fff3d6, #a07a45 55%, #2a2016); }
.sw-warm { background: radial-gradient(circle at 40% 35%, #ffe0a8, #e98a3c); }
.sw-window { background: linear-gradient(105deg, #fffbe8 0%, #fffbe8 40%, #6f86a8 100%); }
.sw-cloudy { background: linear-gradient(#c3cddc, #8794a8); }
.sw-dim { background: radial-gradient(circle, #6a5d52, #0b0908 75%); }
.ang-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ang-chips button { padding: 7px 11px; }
.rng { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; color: #f3eee8; font-size: 13px; font-weight: 600; margin: 0 0 10px; }
.rng output { font-size: 12px; color: #c9c0b6; font-weight: 500; font-variant-numeric: tabular-nums; }
.rng input { grid-column: 1 / -1; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; accent-color: #f0825c; height: 24px; }
.rot-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.rot-row button { justify-content: center; font-size: 14px; }
.lbt-tip { font-size: 12px; color: #a99f94; margin: 0; }
.lbt-keys { font-size: 11px; color: #8f857a; margin: 6px 0 0; line-height: 1.6; }

#toast { position: fixed; left: 50%; bottom: 120px; transform: translate(-50%, 20px); background: var(--primary); color: var(--on-primary); padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow-h); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(16px); opacity: 0; } }

/* ========== 모바일 ========== */
@media (max-width: 860px) {
  .poster-inner { grid-template-columns: 1fr; gap: 36px; }
  .poster-art img { max-height: 42vh; max-width: calc(100% - 32px); }
}
@media (max-width: 760px) {
  .summary { grid-template-columns: 1fr 1fr; }
  .summary div:nth-child(3) { border-left: 0; }
  .summary div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .summary div { padding: 14px 16px; }
  .summary b { font-size: 20px; }
  .podium { grid-template-columns: 1fr; gap: 14px; }
  .rrow { grid-template-columns: 24px 48px 1fr; gap: 12px; padding: 12px 14px; }
  .rrow img { width: 48px; height: 48px; }
  .rrow .exstats { grid-column: 3; flex-wrap: wrap; }
  .open-cta { grid-template-columns: 1fr; padding: 22px; }
  .home-head .btn { width: 100%; }
  .toolbar .seg { width: 100%; }
  .soon-card { width: 250px; }
  .theme-pick { gap: 6px; }
  .tp b { font-size: 12px; } .tp small { display: none; }
  .lrow { grid-template-columns: 52px 1fr; }
  .lrow img { width: 52px; height: 52px; }
  .lact { grid-column: 1 / -1; justify-content: flex-start; }
  #topbar { padding: 0 12px 0 16px; gap: 6px; height: 56px; }
  .tabs a { padding: 0 8px; font-size: 14px; }
  .tabs a.on::after { left: 8px; right: 8px; }
  .icon-btn { width: 34px; height: 34px; }
  .chip:has(.avatar) { padding: 3px; }
  .chip:has(.avatar) .name { display: none; }
  .chip:not(:has(.avatar)) { padding: 6px 10px; font-size: 13px; }
  .logo small { display: none; }
  .page { padding: 24px 16px; }
  .create .step { padding: 16px; }
  .work { grid-template-columns: 64px 1fr auto; gap: 8px; }
  .work img { width: 64px; height: 64px; }
  .bulk { flex-direction: column; align-items: stretch; }
  .poster { padding: 24px 16px; min-height: auto; }
  .poster-info { padding: 22px; }
  .cb-hero { grid-template-columns: 108px 1fr; gap: 10px; }
  .cb-cv { width: 108px; height: 96px; }
  .cb-row { grid-template-columns: 1fr; gap: 0; }
  .cb-species canvas { width: 40px; height: 40px; }
  .lightbox { padding: 60px 12px 14px; }
  .lb-nav { display: none; }
  .lb-img { max-width: calc(100vw - 48px); max-height: calc(100dvh - 270px); }
  .tools-open .lb-img { max-width: calc(100vw - 48px); max-height: calc(48dvh - 150px); }
  .lightbox.tools-open { padding-right: 12px; padding-bottom: calc(50dvh + 8px); }
  .tools-open .lb-close { right: 14px; }
  .tools-open .lb-cap { display: none; }
  .lb-tools { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 50dvh; border-radius: 20px 20px 0 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .lt-grid { grid-template-columns: repeat(3, 1fr); }
  .lt-grid button { flex-direction: column; gap: 4px; text-align: center; padding: 8px 4px; font-size: 12px; }
  .modal-back { place-items: end center; padding: 0; }
  .modal:not(.lightbox) { border-radius: 22px 22px 0 0; width: 100%; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .room-title span, .hide-sm { display: none; }
  .rbtn { padding: 8px 12px; font-size: 13px; }
  .rx { min-width: 0; flex: 1 1 0; padding: 4px 1px 3px; }
  .rx-e { font-size: 19px; }
  .rx-l { font-size: 9.5px; }
  .react-wrap, .emoji-bar, .lb-emo { width: 100%; }
  .react-wrap { justify-items: stretch; }
  .rx-c { left: calc(50% + 5px); height: 15px; line-height: 15px; min-width: 16px; padding: 0 4px; font-size: 9.5px; }
}
@media (max-width: 360px) {
  .tabs a { padding: 0 6px; font-size: 13px; }
  .logo { font-size: 20px; }
}

/* ========== 걸작 친구들 ========== */
.fr-strip { margin-top: 56px; display: grid; grid-template-columns: 1fr 1.6fr; gap: 24px; align-items: center; }
.fr-strip h2 { margin: 4px 0 6px; }
.fr-strip .btn { margin-top: 10px; }
.fr-mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.fm { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 700; text-decoration: none; transition: transform .15s; }
.fm:hover { transform: translateY(-3px); }
.fm canvas { width: 54px; height: 56px; display: block; }
.friends { max-width: 1120px; }
.fr-head { max-width: 640px; margin-bottom: 22px; }
.fr-head h1 { margin: 4px 0 8px; }
.fr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fr-card { display: grid; grid-template-rows: auto 1fr; border-radius: 22px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.fr-stage { height: 170px; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--c) 45%, #fff) 0%, color-mix(in srgb, var(--c) 18%, var(--surface)) 70%); display: grid; place-items: center; }
.fr-stage canvas { width: 180px; height: 150px; display: block; }
.fr-body { padding: 14px 18px 18px; display: grid; gap: 8px; align-content: start; }
.fr-name { display: grid; gap: 1px; }
.fr-name b { font-family: "Gowun Batang", serif; font-size: 26px; line-height: 1.2; }
.fr-name span { font-size: 12.5px; color: var(--muted); }
.fr-quote { margin: 0; font-family: "Gowun Batang", serif; font-size: 15px; color: var(--ink-2); }
.fr-facts { margin: 0; display: grid; gap: 4px; font-size: 13px; }
.fr-facts div { display: grid; grid-template-columns: 84px 1fr; gap: 6px; }
.fr-facts dt { color: var(--muted); }
.fr-facts dd { margin: 0; font-weight: 600; }
.fr-story { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.fr-eds { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0; }
.fr-sw { position: relative; width: 22px; height: 22px; border-radius: 50%; background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); padding: 0; }
.fr-sw.on { box-shadow: 0 0 0 2px var(--ink); }
.fr-sw.orig::after { content: '★'; position: absolute; top: -8px; right: -6px; font-size: 10px; color: #e8734a; }
.fr-body .row { gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.goods { margin-top: 44px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 28px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.goods h2 { margin: 4px 0 6px; }
.rules { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.55; }
.rules b { display: block; color: var(--ink); }
.goods-show { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; }
.goods-show figure { margin: 0; display: grid; justify-items: center; gap: 8px; }
.goods-show figcaption { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.g-sticker img { width: 100%; max-width: 170px; transform: rotate(-6deg); }
.g-key { position: relative; }
.g-key .ring { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #b8b2aa; margin-bottom: -6px; }
.g-key .acryl { display: grid; place-items: center; width: 118px; height: 118px; border-radius: 30px; background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,255,255,.35)); box-shadow: inset 0 0 0 2px rgba(255,255,255,.8), 0 6px 18px rgba(0,0,0,.12); }
.g-key .acryl img { width: 104px; }
.g-badge .badge-c { display: grid; place-items: center; width: 118px; height: 118px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6f8, #ffc9d6); box-shadow: inset 0 -6px 12px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.14); overflow: hidden; }
.g-badge .badge-c img { width: 128px; margin-top: 18px; }
@media (max-width: 720px) {
  .fr-strip, .goods { grid-template-columns: 1fr; }
  .fr-mini { grid-template-columns: repeat(4, 1fr); }
  .goods { padding: 20px; }
  .goods-show { gap: 6px; }
  .g-key .acryl, .g-badge .badge-c { width: 92px; height: 92px; }
  .g-key .acryl img { width: 82px; } .g-badge .badge-c img { width: 100px; }
  .cb-species { grid-template-columns: repeat(4, 1fr); }
}
.sheet-dl { margin-top: 16px; display: grid; gap: 6px; justify-items: start; }
.sheet-dl p { margin: 0; line-height: 1.5; }
.cb-species small { line-height: 1.25; text-align: center; word-break: keep-all; padding: 0 2px; }
.fr-name .fr-pun { font-size: 11.5px; opacity: .8; }

/* ========== 입장 화면: 한 화면 캐릭터 고르기 ========== */
.poster.entry { min-height: calc(100dvh - 64px); padding: 20px 24px; place-items: center; }
.entry-card { width: min(1080px, 100%); background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 24px; padding: 20px 24px 22px; box-shadow: var(--shadow-h); }
.entry-head { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: end; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.entry-head .eyebrow { margin: 0 0 2px; }
.entry .poster-title { font-size: clamp(22px, 2.6vw, 30px); margin: 0 0 4px; line-height: 1.25; }
.entry .poster-dates { margin: 0; font-size: 13px; }
.entry .poster-intro { margin: 6px 0 0; font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.eh-side { display: grid; gap: 6px; justify-items: end; }
.eh-side .exstats { margin: 0; }
.entry .entry-form { border-top: 0; padding-top: 14px; }
.entry .cb { display: grid; grid-template-columns: 300px 1fr; grid-template-areas: "hero opts" "go opts"; gap: 14px 28px; margin: 0; align-items: start; }
.entry .cb-hero { grid-area: hero; grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 6px; margin: 0; padding: 14px 14px 16px; }
.entry .cb-cv { width: 210px; height: 160px; }
.entry .cb-id { justify-items: center; }
.cb-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 4px; }
.cb-tools .btn { margin: 0; }
.entry .cb-opts { grid-area: opts; display: grid; gap: 0; }
.entry .cb-opts .lbl:first-child { margin-top: 0; }
.entry .cb .lbl { margin: 12px 0 7px; }
.entry .cb-go { grid-area: go; display: grid; gap: 8px; align-self: end; }
.entry .cb-go p { margin: 0; text-align: center; }
.entry .cb-name { margin: 0; }
.entry .cb-tastes .cb-opt { grid-auto-flow: column; justify-content: center; align-items: center; gap: 6px; padding: 9px 6px; }
.entry .cb-tastes .cb-opt[aria-checked="true"] { padding: 8px 5px; }
.entry .cb-tastes em { font-size: 18px; }
@media (max-width: 860px) {
  .poster.entry { padding: 10px 12px 0; min-height: auto; place-items: start stretch; }
  .entry-card { padding: 12px 14px 0; border-radius: 18px; }
  .entry-head { grid-template-columns: 1fr; padding-bottom: 8px; }
  .entry .poster-title { font-size: 20px; }
  .entry .poster-intro { display: none; }
  .eh-side { justify-items: start; }
  .eh-side .exstats { display: none; }
  .live-line { font-size: 12.5px; }
  .entry .entry-form { padding-top: 8px; }
  .entry .cb { grid-template-columns: 1fr; grid-template-areas: "hero" "opts" "go"; gap: 6px; }
  .entry .cb-hero { grid-template-columns: 92px 1fr; justify-items: start; text-align: left; padding: 8px 10px; gap: 10px; }
  .entry .cb-cv { width: 92px; height: 78px; }
  .entry .cb-id { justify-items: start; gap: 2px; }
  .entry .cb-id .eyebrow, .entry .cb-quote { display: none; }
  .entry .cb-id b { font-size: 16px; }
  .entry #cb-desc { font-size: 12px; line-height: 1.4; }
  .cb-tools { justify-content: flex-start; gap: 4px; margin-top: 2px; }
  .cb-tools .btn.sm { padding: 5px 9px; font-size: 12px; }
  .entry .cb .lbl { margin: 8px 0 5px; font-size: 13px; }
  .entry .cb-tastes { gap: 4px; }
  .entry .cb-tastes .cb-opt { padding: 7px 3px; font-size: 11.5px; gap: 3px; }
  .entry .cb-tastes .cb-opt[aria-checked="true"] { padding: 6px 2px; }
  .entry .cb-tastes em { font-size: 15px; }
  .entry .cb-species { grid-template-columns: repeat(7, 1fr); gap: 3px; }
  .entry .cb-species .cb-opt { padding: 4px 0 5px; font-size: 11px; }
  .entry .cb-species .cb-opt[aria-checked="true"] { padding: 3px 0 4px; }
  .entry .cb-species canvas { width: 38px; height: 36px; }
  .entry .cb-species small { display: none; } /* 고른 친구의 소개 문구는 위 미리보기에 나온다 */
  .entry .cb-row { grid-template-columns: 1fr; gap: 0; }
  .entry .cb-pal { gap: 5px; flex-wrap: nowrap; }
  .entry .cb-pal .sw { width: 26px; height: 26px; flex: none; }
  .entry .cb-face { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .entry .cb-face .cb-opt { padding: 6px 4px; font-size: 13px; }
  .entry .cb-go { position: sticky; bottom: 0; grid-template-columns: 1fr 1.3fr; align-items: end; gap: 8px; padding: 10px 0 max(12px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--surface) 18%); z-index: 2; }
  .entry .cb-name { font-size: 12px; }
  .entry .cb-name input { padding: 10px 12px; }
  .entry .cb-go .btn.lg { padding: 13px 10px; font-size: 15px; }
}
.fr-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1px var(--line-2); margin-right: 6px; vertical-align: -1px; }

/* ========== 상단 내 캐릭터 칩 ========== */
#nav-user { display: inline-flex; gap: 6px; align-items: center; }
.char-chip { padding: 2px 12px 2px 4px; gap: 4px; }
.char-chip canvas { width: 30px; height: 30px; display: block; }
@media (max-width: 640px) { .char-chip { padding: 2px 4px; } .char-chip canvas { width: 28px; height: 28px; } }

/* ========== 전시 OVERVIEW ========== */
.ov .poster-info { display: grid; gap: 0; }
.ov .eyebrow { letter-spacing: .06em; }
.ov-facts { margin: 0 0 14px; display: grid; gap: 4px; font-size: 13.5px; }
.ov-facts div { display: grid; grid-template-columns: 56px 1fr; gap: 8px; }
.ov-facts dt { color: var(--muted); }
.ov-facts dd { margin: 0; font-weight: 600; }
.ov-facts dd .muted { font-weight: 400; }
.poster-strip .ps { padding: 0; border: 0; background: none; border-radius: 8px; cursor: zoom-in; }
.poster-strip .ps img { display: block; }
.ov-enter { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 2px; }
.ov-me { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; }
.ov-me canvas { width: 64px; height: 58px; display: block; }
.ov-me-txt { display: grid; gap: 1px; min-width: 0; }
.ov-me-txt b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 860px) {
  .ov .poster-inner { gap: 20px; }
  .ov .poster-art img { max-height: 34vh; }
  .ov .poster-intro { font-size: 15px; }
}
@media (max-width: 860px) {
  .ov .poster-art img { max-height: 26vh; }
  .ov .poster-art figcaption { margin-top: 8px; }
  /* 소개를 읽는 동안에도 입장하기 버튼은 화면 아래에 늘 보인다 */
  .ov-enter { position: sticky; bottom: 0; z-index: 3; margin: 0 -22px -22px; padding: 12px 22px max(14px, env(safe-area-inset-bottom)); background: var(--surface); border-radius: 0 0 24px 24px; box-shadow: 0 -8px 20px rgba(0, 0, 0, .12); gap: 8px; }
  .ov-me { grid-template-columns: 48px 1fr auto; }
  .ov-me canvas { width: 48px; height: 44px; }
}

/* ========== 운영: 핵심 지표 카드 · 즉시 내리기 ========== */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.kpi-n { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.kpi b { font-size: 28px; font-family: "Gowun Batang", serif; line-height: 1.2; }
.kpi-g { font-size: 12px; color: var(--accent-d); font-weight: 600; }
.btn.danger { color: var(--bad-ink); border-color: color-mix(in srgb, var(--bad-ink) 40%, var(--line)); }
.btn.primary.danger { background: var(--bad-ink); color: #fff; border-color: transparent; }

/* ========== 지난 전시: 받은 선물 기록 ========== */
.gift-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gift-list li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 8px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; }
.gift-list li.wreath { background: var(--soft); }
.gift-list em { font-style: normal; font-size: 16px; }
/* 운영 표: 좁은 화면에서 제목이 한 글자씩 꺾이지 않게. 표는 상자 안에서 가로로 밀어 본다 */
.admin tbody th[scope="row"] { min-width: 132px; word-break: keep-all; }
.admin td .badge, .admin th[scope="col"] { white-space: nowrap; }
@media (max-width: 640px) {
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi b { font-size: 22px; }
  .kpi-n { font-size: 12px; }
}
/* 상단 바: 캐릭터 칩과 로그인 버튼이 함께 있어도 로고·탭이 두 줄로 꺾이지 않게 */
.logo, .tabs a, #nav-user .chip { white-space: nowrap; flex: none; }
@media (max-width: 400px) {
  #topbar { gap: 4px; padding: 0 8px 0 12px; }
  .tabs { margin-left: 2px; }
  .tabs a { padding: 0 5px; font-size: 13px; }
  .tabs a.on::after { left: 5px; right: 5px; }
  #nav-user { gap: 4px; }
  #nav-user .chip:not(.char-chip) { padding: 6px 10px; font-size: 13px; }
  .char-chip { padding: 1px 3px; }
}
.ov-first { margin: 0; line-height: 1.5; }
/* 봇 확인 상자 (서버 모드에서 의심스러울 때만 뜬다) */
.captcha-box { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; }
/* 계정 탈퇴 */
.acct-links { margin-top: 32px; display: flex; gap: 8px; align-items: center; }
.withdraw-list { margin: 10px 0 12px; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; }

/* ========== 분위기 다듬기: 따뜻한 조명이 드는 갤러리 ========== */
/* 글: 한국어는 단어 중간에서 꺾이지 않게, 제목은 줄 길이를 고르게 */
body { word-break: keep-all; overflow-wrap: anywhere; }
h1, h2, h3, .extitle, .poster-title { text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
html { scrollbar-color: var(--line-2) transparent; }

/* 화면 위쪽에서 은은하게 내려오는 조명 */
body { background: radial-gradient(1100px 480px at 50% -140px, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%) no-repeat, var(--bg); }

/* 로고 옆 낙관(도장) */
.logo::before { content: ""; align-self: center; width: 11px; height: 11px; border-radius: 3px; background: var(--accent); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .28); transform: rotate(-8deg); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.logo:hover::before { transform: rotate(10deg) scale(1.15); }

/* 화면이 바뀔 때 부드럽게 나타나기 (전시관은 제외: 고정 배치라 건드리지 않는다) */
#app > :not(.room) { animation: fade .32s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.podium > li, .fr-card { animation: rise .5s cubic-bezier(.2, .7, .3, 1) both; }
.podium > li:nth-child(2), .fr-card:nth-child(2) { animation-delay: .07s; }
.podium > li:nth-child(3), .fr-card:nth-child(3) { animation-delay: .14s; }
.fr-card:nth-child(n+4) { animation-delay: .2s; }

/* 버튼: 살짝 떠 있는 느낌 */
.btn { transition: transform .15s, background .15s, box-shadow .2s, border-color .15s; }
.btn:hover { border-color: var(--muted); }
.btn.primary, .btn.kakao { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 8px 18px -8px color-mix(in srgb, var(--ink) 50%, transparent); }
.btn.primary:hover { border-color: var(--primary-h); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 12px 22px -8px color-mix(in srgb, var(--ink) 55%, transparent); }
.btn.primary.danger:hover { border-color: transparent; }
.btn.ghost:hover { border-color: transparent; }
.btn:active, .btn.primary:active { transform: scale(.97); }
.btn:disabled { transform: none; box-shadow: none; }

/* 숫자는 제목과 같은 글씨체로 */
.summary b { font-family: "Gowun Batang", serif; font-size: 27px; }

/* 전시 카드: 벽에 걸린 그림 위로 조명 한 줄기 */
.excover::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 62% 70% at 50% -8%, light-dark(rgba(255, 255, 255, .7), rgba(255, 220, 175, .13)), transparent 72%); }
.excover::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; pointer-events: none; background: linear-gradient(transparent, light-dark(rgba(60, 40, 20, .07), rgba(0, 0, 0, .22))); }
.excover img { transition: transform .45s cubic-bezier(.2, .7, .3, 1), opacity .35s, box-shadow .45s; }
.excard:hover .excover img { transform: translateY(-3px) scale(1.035); box-shadow: 0 0 0 7px #fff, 0 0 0 9px rgba(31, 27, 24, .85), 0 24px 34px rgba(0, 0, 0, .28); }
.excard { transition: transform .3s cubic-bezier(.2, .7, .3, 1), box-shadow .3s, border-color .3s; }
.excard:hover, .soon-card:hover { border-color: var(--line-2); }

/* 순위 메달: 금속 광택 */
.rank { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 4px 10px rgba(0, 0, 0, .18); text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.rank.r1 { background: linear-gradient(140deg, #e3be62, #a9771c); }
.rank.r2 { background: linear-gradient(140deg, #b9c1ca, #747d87); }
.rank.r3 { background: linear-gradient(140deg, #cf9365, #8f5630); }

/* 안내 상자: 종이에 스민 따뜻한 색 */
.open-cta, .goods { background: linear-gradient(135deg, var(--surface) 35%, color-mix(in srgb, var(--soft) 70%, var(--surface))); }
.themes-mini figure, .fm { transition: transform .25s cubic-bezier(.2, .7, .3, 1), box-shadow .25s; }
.themes-mini figure:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: var(--shadow-h); }
.fm:hover { box-shadow: var(--shadow); }

/* 빈 화면·안내 그림이 살짝 떠다닌다 */
.state-ill, .exit-ill { animation: bob 3.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }

/* 목록 줄: 올리면 살짝 밀려 들어간다 */
.rrow { transition: background .15s, padding-left .2s; }
.rrow:hover { padding-left: 22px; }
.rrow:hover .rnum { color: var(--accent-d); }

/* 맨 아래 */
#foot { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 28px; }
#foot::before { content: "걸작"; display: block; font-family: "Gowun Batang", serif; font-weight: 700; font-size: 16px; color: var(--ink-2); margin-bottom: 6px; letter-spacing: -.03em; }
/* 좁은 화면에서는 상단 바에 여유가 없어 낙관을 숨긴다 */
@media (max-width: 480px) { .logo::before { display: none; } }
