/* ===== 테마 변수: 관리 → 설정 → 사용자 CSS 에서 덮어쓸 수 있어요 ===== */
:root {
  --bg: #f6f4f1;
  --panel: #ffffff;
  --panel-2: #faf8f5;
  --ink: #26232b;
  --muted: #7a7480;
  --line: #e7e2dc;
  --accent: #6d4fd8;
  --accent-ink: #ffffff;
  --accent-soft: #ebe5fb;
  --ok: #2f9e6b;
  --warn: #c98a1b;
  --bad: #d14b5b;
  --crit: #c9a227;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(30, 20, 50, .05), 0 4px 16px rgba(30, 20, 50, .05);
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --font-story: "Noto Serif KR", "Nanum Myeongjo", "Apple Myungjo", Georgia, serif;
  --top-h: 56px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17151c; --panel: #211e28; --panel-2: #1c1a22; --ink: #ece8f2; --muted: #9c95a6; --line: #332f3c;
    --accent: #9b84ff; --accent-ink: #15121c; --accent-soft: #2e2840; --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 .6em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 1.2em 0 .5em; }
p { margin: 0 0 .8em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.strong { font-weight: 700; }
.big { font-size: 1.15em; }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; margin-top: .8rem; }
.row.between { justify-content: space-between; flex-wrap: wrap; margin-bottom: .6rem; }
.boot { padding: 3rem; text-align: center; color: var(--muted); }

/* ===== 폼 ===== */
input, textarea, select {
  font: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .7rem; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
input[type=color] { width: 48px; height: 34px; padding: 2px; }
textarea { resize: vertical; line-height: 1.6; }
.field { display: block; margin-bottom: .9rem; flex: 1; }
.field .label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .3rem; }
.help { display: block; color: var(--muted); font-size: .78rem; margin-top: .25rem; }
.check { display: flex; align-items: center; gap: .4rem; cursor: pointer; }
.check.field .help { display: inline; }
fieldset { border: 0; }
legend { font-weight: 700; padding: 0; margin-bottom: .6rem; float: left; width: 100%; }
fieldset > * { clear: both; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem; font: inherit; font-weight: 600;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px;
  padding: .5rem 1rem; cursor: pointer; white-space: nowrap; transition: background .15s, transform .05s;
}
.btn:hover { background: var(--panel-2); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: .3rem .7rem; font-size: .85rem; }
.btn.block { width: 100%; margin-top: .4rem; }
.btn.link { border: 0; background: none; color: var(--accent); font-weight: 500; }
.danger-text { color: var(--bad) !important; }
.icon-btn { border: 0; background: none; color: inherit; font-size: 1.1rem; cursor: pointer; width: 32px; height: 32px; border-radius: 8px; }
.icon-btn:hover:not(:disabled) { background: var(--accent-soft); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.link-btn { border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: .8rem; padding: 0 .3rem; }
.link-btn:hover { color: var(--accent); }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.badge.ok { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.chip { display: inline-flex; align-items: center; gap: .2rem; padding: .2rem .7rem; border-radius: 99px; background: var(--accent-soft); color: var(--ink); font-size: .85rem; border: 1px solid transparent; }
.btn-chip { cursor: pointer; font: inherit; font-size: .85rem; }
.btn-chip:hover, .btn-chip.on { border-color: var(--accent); color: var(--accent); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.card-head h2 { margin: 0; font-size: 1.1rem; }
.card.notice { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.card.notice.bad { background: color-mix(in srgb, var(--bad) 12%, var(--panel)); }
.empty { padding: 2rem 1rem; text-align: center; color: var(--muted); }
.empty.error { color: var(--bad); }

/* ===== 인증 화면 ===== */
.auth-wrap { min-height: 100%; display: grid; place-items: center; padding: 1.5rem; background: radial-gradient(circle at 20% 10%, var(--accent-soft), transparent 50%), var(--bg); }
.auth-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 2rem 1.8rem; box-shadow: var(--shadow); }
.auth-title { text-align: center; font-family: var(--font-story); font-size: 1.7rem; margin-bottom: .2rem; }

/* ===== 레이아웃 ===== */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: .8rem; padding: 0 1rem; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--font-story); font-weight: 700; font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.menu-btn { display: none; }
.switcher { display: flex; align-items: center; gap: .4rem; }
.char-select { width: auto; max-width: 140px; padding: .3rem .5rem; font-weight: 600; }
.user-chip { font-size: .85rem; color: var(--muted); display: flex; gap: .3rem; align-items: center; white-space: nowrap; }
.badge.admin { background: var(--accent); color: var(--accent-ink); }

.layout { display: flex; min-height: calc(100vh - var(--top-h)); }
.sidenav { width: 220px; flex-shrink: 0; padding: 1rem .6rem; border-right: 1px solid var(--line); background: var(--panel-2); position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; }
.sidenav a { display: flex; align-items: center; justify-content: space-between; padding: .45rem .7rem; border-radius: 8px; font-size: .93rem; margin-bottom: 1px; }
.sidenav a:hover { background: var(--accent-soft); color: var(--ink); }
.sidenav a.active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.nav-title { font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .05em; padding: 1rem .7rem .3rem; }
.nav-empty { font-size: .8rem; color: var(--muted); padding: .3rem .7rem; }
.online-dot { font-size: .72rem; background: var(--ok); color: #fff; border-radius: 99px; padding: 0 7px; font-weight: 700; }
.main { flex: 1; min-width: 0; }
.page { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1.2rem 4rem; }
.page.narrow { max-width: 720px; }
.back { display: inline-block; color: var(--muted); font-size: .9rem; margin-bottom: .6rem; }

/* ===== 홈 ===== */
.hero { padding: 1.6rem 1.4rem; border-radius: 16px; margin-bottom: 1rem; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #f0a)); color: #fff; }
.hero h1 { font-family: var(--font-story); font-size: 1.8rem; margin-bottom: .3rem; }
.hero-text p:last-child { margin: 0; }
.hero-text { opacity: .92; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.home-grid .card { margin: 0; }
.span2 { grid-column: span 2; }
.my-char { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.my-char:first-of-type { border-top: 0; }
.ann { border-top: 1px solid var(--line); padding: .5rem 0; }
.ann summary { cursor: pointer; }
.ann-body { padding: .5rem 0 0 .2rem; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .8rem; }
.loc-card { min-height: 110px; border-radius: 12px; padding: 1rem; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(135deg, var(--accent-soft), var(--panel-2)); background-size: cover; background-position: center; border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.loc-card[style] { color: #fff; border: 0; }
.loc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.loc-card[style]:hover { color: #fff; }
.loc-name { font-weight: 700; font-size: 1.05rem; }
.loc-meta { font-size: .78rem; opacity: .85; }

/* ===== 아바타 ===== */
.avatar { border-radius: 50%; object-fit: cover; display: block; background: var(--accent-soft); }
.avatar.ph { display: grid; place-items: center; color: #fff; font-weight: 700; }

/* ===== 장소 / 채팅 ===== */
.loc-page { display: flex; flex-direction: column; height: calc(100vh - var(--top-h)); }
.loc-page.threads { height: auto; }
.loc-page.threads > :not(.loc-head) { margin-left: 1.2rem; margin-right: 1.2rem; }
.loc-head { display: flex; align-items: flex-start; gap: 1rem; padding: .9rem 1.2rem .6rem; border-bottom: 1px solid var(--line); background: var(--panel); flex-wrap: wrap; }
.loc-head h2 { margin: 0; }
.loc-desc summary { cursor: pointer; color: var(--muted); font-size: .85rem; }
.loc-desc > div { padding: .4rem 0; font-size: .92rem; max-width: 70ch; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; }
.tabs a { padding: .4rem .9rem; border-radius: 99px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.tabs a.active { background: var(--accent-soft); color: var(--accent); }
.loc-page > .card.notice { margin: .6rem 1.2rem 0; }

.chat-wrap { flex: 1; display: flex; min-height: 0; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.messages { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .15rem; }
.older { align-self: center; margin-bottom: .5rem; }
.chat-side { width: 230px; border-left: 1px solid var(--line); padding: .4rem 1rem 1rem; overflow-y: auto; background: var(--panel-2); font-size: .9rem; }
.presence { display: flex; flex-direction: column; gap: .3rem; }
.presence-item { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
.kw-list { display: flex; flex-wrap: wrap; gap: .3rem; }
.help-list { list-style: none; padding: 0; margin: 0; font-size: .8rem; color: var(--muted); }
.help-list li { margin-bottom: .3rem; }

.msg { position: relative; display: flex; gap: .7rem; padding: .3rem .5rem; border-radius: 8px; }
.msg:hover { background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.msg-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.msg.say { margin-top: .5rem; }
.msg-av { flex-shrink: 0; }
.msg-head { display: flex; align-items: baseline; gap: .5rem; }
.who { font-weight: 700; }
.msg-time { font-size: .72rem; color: var(--muted); margin-left: .4rem; }
.msg-text { font-family: var(--font-story); font-size: 1.02rem; line-height: 1.7; }
.msg.action .msg-main { font-family: var(--font-story); font-style: italic; color: color-mix(in srgb, var(--ink) 80%, var(--muted)); padding-left: 3.1rem; }
.act-mark { color: var(--accent); font-style: normal; }
.msg.ooc .msg-main { font-size: .82rem; color: var(--muted); padding-left: 3.1rem; }
.msg.narration { justify-content: center; margin: .8rem 0; }
.msg.narration .msg-main { flex: 0 1 640px; text-align: center; font-family: var(--font-story); padding: .8rem 1.2rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.narr-text p { margin: .2rem 0; }
.msg.sys .msg-main { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .45rem .8rem; margin-left: 3.1rem; font-size: .9rem; }
.msg.sys.ephemeral .msg-main { border-style: dashed; background: transparent; color: var(--muted); }
.msg.explore.success .msg-main { border-left: 3px solid var(--ok); }
.msg.explore.failed .msg-main { border-left: 3px solid var(--bad); }
.msg.item .msg-main { border-left: 3px solid var(--accent); }
.roll-icon { margin-right: .35rem; }
.result { display: inline-block; margin-left: .5rem; font-weight: 800; font-size: .78rem; padding: 1px 8px; border-radius: 99px; color: #fff; }
.result.ok { background: var(--ok); } .result.bad { background: var(--bad); }
.result.crit { background: linear-gradient(90deg, var(--crit), #f3d46b); color: #3b2c00; }
.result.fumble { background: #4b4453; }
.explore-text { font-family: var(--font-story); margin-top: .3rem; }
.explore-text p { margin: 0 0 .3rem; }
.rewards { margin-top: .3rem; display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; font-size: .85rem; }
.msg-del { position: absolute; right: .4rem; top: .3rem; border: 0; background: var(--panel); color: var(--muted); border-radius: 6px; cursor: pointer; opacity: 0; font-size: .75rem; padding: 2px 6px; }
.msg:hover .msg-del, .msg-del:focus { opacity: 1; }
.spoiler { background: var(--ink); color: transparent; border-radius: 4px; cursor: pointer; padding: 0 3px; transition: .2s; }
.spoiler.open { background: var(--accent-soft); color: inherit; }

.composer { border-top: 1px solid var(--line); background: var(--panel); padding: .5rem .8rem .8rem; }
.toolbar { display: flex; gap: .3rem; margin-bottom: .4rem; flex-wrap: wrap; }
.tool { border: 0; background: none; font: inherit; font-size: .85rem; color: var(--muted); padding: .25rem .6rem; border-radius: 6px; cursor: pointer; }
.tool:hover { background: var(--accent-soft); color: var(--ink); }
.tool-panel { padding: .6rem; margin-bottom: .5rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.tool-panel input { width: auto; }
.compose-row { display: flex; gap: .5rem; align-items: flex-end; }
.speaker { width: auto; max-width: 130px; font-weight: 600; }
.chat-input { min-height: 42px; max-height: 180px; resize: none; }
.send { height: 42px; }

/* ===== 스레드 ===== */
.thread-list { display: flex; flex-direction: column; gap: .5rem; padding-bottom: 3rem; }
.thread-row { display: flex; gap: .8rem; align-items: center; padding: .8rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.thread-row:hover { border-color: var(--accent); color: inherit; }
.thread-title { font-weight: 700; }
.thread-meta { text-align: right; font-size: .85rem; white-space: nowrap; }
.posts { display: flex; flex-direction: column; gap: 1rem; margin: 1rem 0; }
.post { display: flex; gap: 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.post-main { flex: 1; min-width: 0; }
.post-head { margin-bottom: .5rem; display: flex; align-items: baseline; flex-wrap: wrap; }
.post-actions { margin-left: auto; }
.post-body { font-family: var(--font-story); font-size: 1.03rem; line-height: 1.85; overflow-wrap: anywhere; }
.reply textarea { margin-bottom: 0; }

/* ===== 캐릭터 ===== */
.search { max-width: 280px; margin-bottom: 1rem; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.char-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; border-top: 4px solid var(--c, var(--accent)); transition: transform .15s; }
.char-card:hover { transform: translateY(-3px); color: inherit; box-shadow: var(--shadow); }
.char-card img, .char-ph { width: 100%; aspect-ratio: 1; object-fit: cover; display: grid; place-items: center; background: var(--panel-2); }
.char-card-body { padding: .6rem .8rem .8rem; }
.char-hero { display: flex; gap: 1.5rem; align-items: flex-start; margin-bottom: 1rem; }
.char-img { width: 220px; aspect-ratio: 3/4; object-fit: cover; border-radius: 16px; border: 3px solid var(--c, var(--accent)); flex-shrink: 0; }
.char-img.ph { display: grid; place-items: center; background: var(--panel-2); }
.char-hero h1 { font-family: var(--font-story); font-size: 2rem; margin-bottom: .1rem; }
.char-title { font-family: var(--font-story); color: var(--muted); font-size: 1.05rem; }
.stats { display: flex; flex-direction: column; gap: .35rem; margin: 1rem 0; max-width: 380px; }
.stat { display: grid; grid-template-columns: 4em 1fr 2em; align-items: center; gap: .6rem; font-size: .9rem; }
.stat-name { font-weight: 600; }
.stat-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.fill { height: 100%; background: var(--c, var(--accent)); border-radius: 99px; transition: width .2s; }
.prose { font-family: var(--font-story); line-height: 1.85; overflow-wrap: anywhere; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.two-col .card { margin: 0; }
.ledger { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.ledger li { padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.plus { color: var(--ok); } .minus { color: var(--bad); }
.stat-edit { display: flex; flex-direction: column; gap: .3rem; }
.stat-row { display: grid; grid-template-columns: 4em 32px 2em 32px 1fr; align-items: center; gap: .4rem; }
.stat-row .stat-val { text-align: center; }
.remain { font-weight: 700; color: var(--accent); }
.remain.bad { color: var(--bad); }
.img-row { align-items: flex-start; gap: 1rem; }
.img-preview { width: 96px; height: 128px; border-radius: 10px; border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; flex-shrink: 0; }
.img-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ===== 상점·소지품 ===== */
.wallet { display: flex; align-items: center; gap: .8rem; }
.coins { font-weight: 800; font-size: 1.1rem; color: var(--accent); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.shop-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: .3rem; }
.shop-item.soldout { opacity: .55; }
.shop-icon { font-size: 2.2rem; line-height: 1.2; }
.shop-item .desc { flex: 1; }
.price { font-weight: 700; }
.qty { width: 4.5em; padding: .3rem .5rem; }
.inv-list { display: flex; flex-direction: column; gap: .5rem; }
.inv-item { display: flex; align-items: center; gap: .7rem; padding: .5rem; border: 1px solid var(--line); border-radius: 10px; }
.item-icon { font-size: 1.6rem; }

/* ===== 관리 ===== */
.admin-tabs { margin-bottom: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .6rem; }
.admin-table { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .78rem; color: var(--muted); font-weight: 600; background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
tr.hl td { background: color-mix(in srgb, var(--warn) 9%, transparent); }
td.actions { white-space: nowrap; text-align: right; }
td.actions .btn { margin-left: .2rem; }
.review .row { align-items: flex-start; }
.review details { margin: .6rem 0; }
.review summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.settings-form .card { display: block; }
.sticky-save { position: sticky; bottom: 0; padding: .8rem 0; background: linear-gradient(transparent, var(--bg) 40%); }

/* ===== 모달·토스트 ===== */
.modal-back { position: fixed; inset: 0; background: rgba(20, 15, 30, .45); display: grid; place-items: center; z-index: 100; padding: 1rem; animation: fade .15s; }
.modal { background: var(--panel); border-radius: 16px; width: min(440px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.wide { width: min(680px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem .4rem; }
.modal-head h3 { margin: 0; }
.modal-body { padding: .6rem 1.2rem 1.2rem; overflow-y: auto; }
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 200; max-width: min(380px, calc(100vw - 2rem)); }
.toast { background: var(--ink); color: var(--bg); padding: .7rem 1rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: up .2s; font-size: .9rem; }
.toast.success { background: var(--ok); color: #fff; }
.toast.error { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

/* ===== 모바일 ===== */
@media (max-width: 900px) {
  .chat-side { display: none; }
  .home-grid, .two-col { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
}
@media (max-width: 720px) {
  .menu-btn { display: block; }
  .sidenav { position: fixed; left: 0; top: var(--top-h); z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .sidenav { transform: none; }
  .user-chip { display: none; }
  .char-hero { flex-direction: column; align-items: center; text-align: center; }
  .char-hero > .grow { width: 100%; }
  .char-hero .stats { margin: 1rem auto; width: 100%; }
  .chat-input::placeholder { font-size: .85rem; }
  .char-hero .row { justify-content: center; }
  .char-img { width: 180px; }
  .speaker { max-width: 90px; }
  .msg.action .msg-main, .msg.ooc .msg-main { padding-left: 0; }
  .msg.sys .msg-main { margin-left: 0; }
  .page { padding: 1rem .8rem 4rem; }
  .post { flex-direction: column; gap: .5rem; }
  .post-side .avatar { width: 44px !important; height: 44px !important; min-width: 44px !important; }
}
