:root {
  --bg: #fff8f0;
  --ink: #3a3340;
  --muted: #8a8094;
  --line: #f0e2d4;
  --card: #ffffff;
  --primary: #ff7a59;
  --primary-ink: #ffffff;
  --primary-soft: #ffe3d8;
  --mint: #7fd1b9;
  --lav: #b9a7ff;
  --danger: #e85d5d;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(120, 80, 60, 0.14), 0 2px 6px rgba(120, 80, 60, 0.08);
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body[data-screen="app"], body[data-screen="creator"] { overflow: hidden; overscroll-behavior: none; }
[hidden], .hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--primary); }
h1, h2, h3, h4 { letter-spacing: -0.02em; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.pre { white-space: pre-wrap; }
.row { display: flex; gap: 8px; align-items: center; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.row > .input { flex: 1; min-width: 0; }

/* ── 버튼 · 입력 ── */
.btn { border: 0; border-radius: 999px; padding: 10px 18px; background: #f6ece3; font-weight: 700; transition: transform .12s, background .15s, box-shadow .15s; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.btn:hover { background: #f1e2d5; }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 6px 16px rgba(255, 122, 89, 0.35); }
.btn.primary:hover { background: #ff6a45; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: #fff3ea; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger-text { color: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.lg { padding: 14px 22px; font-size: 16px; width: 100%; justify-content: center; }
.icon-btn { border: 0; width: 40px; height: 40px; border-radius: 14px; background: rgba(255, 255, 255, 0.92); box-shadow: var(--shadow); font-size: 18px; display: inline-grid; place-items: center; transition: transform .12s; flex: none; }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn.sm { width: 30px; height: 30px; font-size: 14px; box-shadow: none; background: transparent; }
.icon-btn.active { background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary) inset, var(--shadow); }
.input { width: 100%; border: 1.5px solid var(--line); background: #fffdfb; border-radius: 14px; padding: 10px 14px; font: inherit; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
textarea.input { resize: vertical; }
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 13px; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.form-error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 13px; }
.toggle { display: flex; gap: 8px; align-items: center; cursor: pointer; font-size: 14px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--primary); }
.code { background: #f6ece3; padding: 12px 16px; border-radius: 12px; font-size: 20px; text-align: center; user-select: all; }

/* ── 첫 화면 ── */
#landing { min-height: 100%; }
.hero { max-width: 1120px; margin: 0 auto; padding: 48px 24px 24px; display: grid; grid-template-columns: 1.25fr 0.9fr; gap: 40px; align-items: center; }
.eyebrow { font-weight: 800; color: var(--primary); margin: 0 0 8px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.15; }
.hl { background: linear-gradient(transparent 60%, #ffd6c8 60%); }
.lead { font-size: 17px; color: #5d5466; max-width: 34em; }
.live { display: inline-block; background: #e8f8f1; color: #23845f; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.hero-img { width: 100%; height: auto; border-radius: 28px; margin-top: 18px; box-shadow: var(--shadow); }
.auth-card { background: var(--card); border-radius: 28px; padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #f8efe6; border-radius: 999px; padding: 4px; }
.auth-tabs button { border: 0; background: transparent; padding: 10px; border-radius: 999px; font-weight: 800; color: var(--muted); }
.auth-tabs button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
#auth-form.login .only-register { display: none; }
.features { max-width: 1180px; margin: 0 auto; padding: 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.features article { background: #fff; border-radius: 22px; padding: 20px; box-shadow: 0 4px 14px rgba(120, 80, 60, .07); }
.features .f-ic { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); }
.features article:nth-child(4n+2) .f-ic { background: #e3f4ec; color: #2f9e74; }
.features article:nth-child(4n+3) .f-ic { background: #ece7ff; color: #7a63e0; }
.features article:nth-child(4n+4) .f-ic { background: #fff1cc; color: #d48a12; }
.features .f-ic .ic { width: 28px; height: 28px; }
.eyebrow .ic { width: 1.25em; height: 1.25em; vertical-align: -0.28em; }
.features h2 { font-size: 17px; margin: 6px 0 4px; }
.features p { margin: 0; color: #6d6475; font-size: 14px; }
.foot { text-align: center; color: var(--muted); padding: 30px 0 40px; font-size: 13px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; gap: 24px; }
  .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }

/* ── 불러오는 화면 ── */
.splash { position: fixed; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: radial-gradient(circle at 50% 40%, #fff1e6, var(--bg)); }
.splash img { border-radius: 26px; box-shadow: var(--shadow); animation: bob 1.4s ease-in-out infinite; }
.progress { width: 220px; height: 8px; border-radius: 99px; background: #f3e4d6; overflow: hidden; }
.progress i { display: block; height: 100%; width: 5%; background: var(--primary); border-radius: 99px; transition: width .2s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* ── 캐릭터 만들기 ── */
.screen { position: fixed; inset: 0; }
.creator { height: 100%; display: grid; grid-template-columns: 1fr 440px; background: radial-gradient(circle at 30% 40%, #fff0e4, var(--bg) 70%); }
.creator-left { position: relative; display: flex; flex-direction: column; }
.creator-stage { flex: 1; min-height: 260px; cursor: grab; touch-action: none; }
.creator-stage canvas { width: 100%; height: 100%; display: block; }
.creator-left .hint { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 13px; margin: 0; pointer-events: none; }
.creator-right { background: #fff; padding: 24px 24px calc(24px + var(--safe-b)); overflow: auto; display: flex; flex-direction: column; gap: 14px; box-shadow: -8px 0 30px rgba(120, 80, 60, 0.08); }
.creator-right h1 { font-size: 24px; }
.creator-panel { display: flex; flex-direction: column; gap: 14px; }
.opt-label { font-size: 13px; font-weight: 800; margin-bottom: 6px; color: #5d5466; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; transition: all .12s; }
.chip:hover { border-color: #ffc2ad; }
.chip.on { background: var(--primary-soft); border-color: var(--primary); color: #c2462a; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); padding: 0; transition: transform .12s; }
.swatch.on { box-shadow: 0 0 0 2.5px var(--primary); transform: scale(1.1); }
.swatch-custom { width: 32px; height: 32px; border: 0; padding: 0; background: none; cursor: pointer; }
.creator-actions { margin-top: auto; position: sticky; bottom: -24px; padding: 14px 0 calc(24px + var(--safe-b)); margin-bottom: calc(-24px - var(--safe-b)); background: linear-gradient(rgba(255, 255, 255, 0), #fff 30%); }
.creator-actions .btn.primary { flex: 1; justify-content: center; }
@media (max-width: 860px) {
  .creator { grid-template-columns: 1fr; grid-template-rows: 38vh 1fr; }
  .creator-right { border-radius: 26px 26px 0 0; box-shadow: 0 -8px 30px rgba(120, 80, 60, .1); }
}

/* ── 공간 ── */
.app { position: fixed; inset: 0; overflow: hidden; }
.world { position: absolute; inset: 0; touch-action: none; }
.world-canvas { width: 100%; height: 100%; display: block; outline: none; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.world-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: var(--bg); color: var(--muted); font-weight: 700; z-index: 5; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar { position: absolute; top: calc(10px + var(--safe-t)); left: 12px; right: 12px; display: flex; gap: 8px; align-items: center; pointer-events: none; z-index: 3; }
.topbar > * { pointer-events: auto; }
.topbar .spacer { flex: 1; pointer-events: none; }
.brand { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.92); border-radius: 16px; padding: 5px 14px 5px 5px; box-shadow: var(--shadow); }
.brand img { width: 30px; height: 30px; border-radius: 10px; }
.pill { background: rgba(255, 255, 255, 0.92); border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; box-shadow: var(--shadow); white-space: nowrap; }
.banner { position: absolute; top: calc(62px + var(--safe-t)); left: 50%; transform: translateX(-50%); max-width: min(720px, calc(100% - 24px)); display: flex; align-items: center; gap: 8px; background: #fff7d6; border: 1.5px solid #ffe08a; border-radius: 16px; padding: 6px 8px 6px 14px; box-shadow: var(--shadow); z-index: 3; font-size: 14px; }
.banner-text { cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat { --chat-a: .94; position: absolute; left: 12px; bottom: calc(84px + var(--safe-b)); width: 340px; max-height: 42vh; display: flex; flex-direction: column; background: rgba(255, 255, 255, var(--chat-a)); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 3; overflow: hidden; backdrop-filter: blur(6px); }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; user-select: none; }
.chat-head .chev { margin-left: auto; transition: transform .2s; }
.chat.collapsed .chev { transform: rotate(180deg); }
.chat.collapsed .chat-log, .chat.collapsed .chat-form { display: none; }
.chat.collapsed { width: auto; }
.badge { background: var(--primary); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 800; }
.chat-log { flex: 1; overflow-y: auto; padding: 0 12px 6px; display: flex; flex-direction: column; gap: 3px; min-height: 120px; }
.msg { font-size: 13.5px; line-height: 1.45; word-break: break-word; }
.msg .who { margin-right: 6px; cursor: default; }
.msg.user .who { cursor: pointer; color: #6a4fd6; }
.msg.mine .who { color: var(--primary); }
.msg.npc { color: #7a5a6e; }
.msg.npc .who::before { content: "✦ "; color: #ff9db0; }
.msg.private { background: #fff3f6; border-radius: 8px; padding: 2px 6px; }
.msg.announce { background: #fff7d6; border-radius: 10px; padding: 6px 8px; font-weight: 700; }
.msg time { color: #c0b6c8; font-size: 11px; margin-left: 6px; }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.chat-form .input { padding: 8px 12px; border-radius: 12px; }

.dock { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(12px + var(--safe-b)); display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.95); padding: 8px; border-radius: 22px; box-shadow: var(--shadow); z-index: 3; max-width: calc(100% - 24px); }
.seg { display: inline-flex; background: #f8efe6; border-radius: 16px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 13px; padding: 7px 12px; font-weight: 800; font-size: 13px; color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.seg button em { font-style: normal; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, .08), inset 0 -3px 0 var(--c, var(--primary)); }
.timer-box { display: flex; flex-direction: column; align-items: center; line-height: 1.1; padding: 0 6px; }
.timer-box small { color: var(--muted); font-size: 11px; font-weight: 700; }
.timer { font: 800 18px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: -0.02em; }
.timer-box.live .timer { color: #23a173; }
.timer-box.live small::before { content: "● "; color: #3ecf8e; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.focus-input { width: 210px; padding: 8px 12px; border-radius: 12px; }
.emote-wrap { position: relative; }
.emote-wrap .icon-btn { box-shadow: none; background: #f8efe6; }
.emote-box { position: absolute; bottom: 52px; right: 0; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 6px; display: grid; grid-template-columns: repeat(4, 40px); gap: 2px; }
.emote-box button { border: 0; background: transparent; font-size: 22px; height: 40px; border-radius: 10px; }
.emote-box button:hover { background: #fff3ea; }

.quick { position: absolute; right: 12px; bottom: calc(84px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; z-index: 3; }
.chips-float { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); display: flex; gap: 8px; z-index: 3; flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100% - 140px); }
.chip-btn { border: 0; background: var(--ink); color: #fff; border-radius: 999px; padding: 9px 16px; font-weight: 800; box-shadow: var(--shadow); animation: pop .25s ease-out; }
.chip-btn:hover { background: #2a2430; }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }

.music-card { position: absolute; right: 12px; top: calc(62px + var(--safe-t)); width: 284px; background: rgba(255, 255, 255, 0.96); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; z-index: 4; }
.music-card b { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.music-card .yt, .music-card .yt iframe { width: 256px; height: 144px; border-radius: 12px; overflow: hidden; display: block; border: 0; background: #000; }
.music-err { margin: 0; font-size: 12.5px; color: #b5452e; background: #fff1ec; border-radius: 10px; padding: 6px 10px; }
.music-card input[type=range] { flex: 1; accent-color: var(--primary); }
.conn { position: absolute; top: calc(64px + var(--safe-t)); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; z-index: 6; }

/* ── 머리 위 이름표 · 말풍선 ── */
.ent { display: flex; flex-direction: column; align-items: center; gap: 3px; transform: translateY(-6px); pointer-events: none; }
.ent .tag { display: inline-flex; align-items: center; gap: 5px; background: rgba(255, 255, 255, 0.9); border-radius: 999px; padding: 2px 10px 2px 7px; font-size: 12px; box-shadow: 0 2px 8px rgba(60, 40, 30, .14); white-space: nowrap; }
.ent .tag b { font-weight: 800; }
.ent .tag small { color: var(--muted); font-size: 10.5px; }
.ent .dot, .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #ccc; flex: none; }
.ent.working .tag .dot { box-shadow: 0 0 0 3px rgba(62, 207, 142, .25); }
.ent.admin .tag b::after { content: " ⭐"; font-size: 10px; }
.ent.me .tag { background: #fff2ec; box-shadow: 0 0 0 1.5px #ffc2ad, 0 2px 8px rgba(60, 40, 30, .14); }
.ent.npc .tag { background: rgba(255, 244, 248, 0.95); }
.ent .focus { font-size: 11px; color: #5d5466; background: rgba(255, 255, 255, 0.78); border-radius: 8px; padding: 1px 8px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubbles { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 2px; }
.bubble { position: relative; max-width: 220px; background: #fff; border-radius: 14px; padding: 6px 11px; font-size: 13px; line-height: 1.4; box-shadow: 0 4px 14px rgba(60, 40, 30, .18); opacity: 0; transform: translateY(6px) scale(.9); transition: all .22s cubic-bezier(.2, 1.4, .4, 1); word-break: break-word; text-align: center; }
.bubble.in { opacity: 1; transform: none; }
.bubble.npc { background: #fff4f8; }
.bubble.private { background: #fff4f8; box-shadow: 0 0 0 1.5px #ffc6d6, 0 4px 14px rgba(60, 40, 30, .18); }
.bubble:last-child::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-top-color: inherit; border-bottom: 0; border-top-color: #fff; }
.bubble.npc:last-child::after, .bubble.private:last-child::after { border-top-color: #fff4f8; }
.emote-pop { position: absolute; top: -10px; font-size: 30px; animation: emote 2.4s ease-out forwards; }
@keyframes emote { 0% { transform: translateY(10px) scale(.4); opacity: 0; } 15% { transform: translateY(-10px) scale(1.2); opacity: 1; } 70% { opacity: 1; } 100% { transform: translateY(-46px) scale(1); opacity: 0; } }

/* ── 모달 ── */
.modal-back { position: fixed; inset: 0; background: rgba(58, 40, 50, 0.28); display: grid; place-items: center; z-index: 50; padding: 16px; opacity: 0; transition: opacity .18s; }
.modal-back.in { opacity: 1; }
.modal { background: #fff; border-radius: 24px; box-shadow: 0 30px 60px rgba(60, 30, 20, .25); width: min(480px, 100%); max-height: calc(100% - 20px); display: flex; flex-direction: column; transform: translateY(10px) scale(.98); transition: transform .2s; }
.modal-back.in .modal { transform: none; }
.modal.wide { width: min(780px, 100%); }
.modal.small { width: min(400px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px 22px; }
.modal-head h2 { font-size: 19px; }
.modal-head .icon-btn { box-shadow: none; background: #f8efe6; width: 34px; height: 34px; font-size: 14px; }
.modal-body { padding: 8px 22px 22px; overflow: auto; }
.modal.side { position: fixed; right: 16px; top: 16px; bottom: 16px; width: min(400px, calc(100% - 32px)); max-height: none; }
.modal-back:has(.modal.side) { background: transparent; pointer-events: none; }
.modal-back:has(.modal.side) .modal { pointer-events: auto; }
.confirm-text { font-size: 16px; }
.tabs { display: flex; gap: 4px; border-bottom: 1.5px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 10px 12px; font-weight: 800; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1.5px; white-space: nowrap; }
.tab.on { color: var(--ink); border-bottom-color: var(--primary); }
.tab-body { display: flex; flex-direction: column; gap: 12px; }
.tab-body h4 { font-size: 14px; margin-top: 6px; }

.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
.menu-item { border: 1.5px solid var(--line); background: #fffdfb; border-radius: 18px; padding: 12px; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 10px; text-align: left; transition: all .12s; }
.menu-item:hover { border-color: var(--primary); background: #fff6f1; transform: translateY(-2px); }
.menu-item .cup { grid-row: span 2; width: 40px; height: 46px; position: relative; border-radius: 4px 4px 12px 12px; background: linear-gradient(#fff 0 22%, var(--c) 22% 100%); box-shadow: inset 0 0 0 2px #e8dccf; }
.menu-item .cup::after { content: ""; position: absolute; left: -3px; right: -3px; top: -4px; height: 8px; border-radius: 4px; background: #f3ede6; box-shadow: inset 0 0 0 2px #e8dccf; }
.menu-item small { color: var(--muted); font-size: 12px; }

.decor .opt { margin-bottom: 12px; }
.decor-actions { position: sticky; bottom: -22px; margin: 0 -22px -22px; padding: 12px 22px 18px; background: #fff; border-top: 1.5px solid var(--line); border-radius: 0 0 24px 24px; }
.decor .chips .chip { font-size: 12.5px; padding: 5px 10px; }

.stats-head { display: flex; gap: 14px; align-items: center; }
.stats-head h3 { font-size: 20px; }
.thumb { width: 44px; height: 44px; border-radius: 14px; background: #fff1e6; object-fit: cover; flex: none; }
.thumb.lg { width: 84px; height: 84px; border-radius: 24px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: #f6f1f8; margin-top: 4px; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.today-box { margin-left: auto; text-align: right; background: #eefaf4; border-radius: 16px; padding: 8px 14px; }
.today-box small { display: block; color: #23845f; font-weight: 700; font-size: 12px; }
.big-timer { font: 800 26px/1.1 ui-monospace, "SF Mono", Menlo, monospace; color: #1f7a57; }
.punch { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff8e1; border-radius: 16px; padding: 10px 12px; margin: 12px 0; }
.punch .muted { font-weight: 800; margin-right: auto; }
.stat-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.stat-card { background: #fbf6f1; border-radius: 16px; padding: 10px 12px; }
.stat-card small { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-card b { font-size: 17px; }
.chart { width: 100%; height: auto; }
.chart .bar { fill: #ffc2ad; }
.chart .bar.today { fill: var(--primary); }
.chart .bar.empty { fill: #f2e9e1; }
.chart .grid { stroke: #f1e7de; stroke-dasharray: 3 4; }
.chart .axis { font-size: 10px; fill: #a69bb0; }
.chart .axis.strong { fill: var(--primary); font-weight: 800; }
.sessions { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.sessions li { display: flex; justify-content: space-between; background: #fbf6f1; border-radius: 10px; padding: 6px 12px; font-size: 13px; }
.rank { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.rank li { display: grid; grid-template-columns: 34px 40px minmax(90px, 160px) 1fr 86px; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 14px; background: #fbf6f1; cursor: pointer; }
.rank li:hover { background: #fff0e8; }
.rank .rk { font-weight: 800; text-align: center; }
.rank .thumb { width: 40px; height: 40px; border-radius: 12px; }
.rank .nm { font-weight: 800; display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; }
.rank b { text-align: right; }
.bar-wrap { height: 12px; background: #f2e7dd; border-radius: 99px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, #ffb59e, var(--primary)); border-radius: 99px; }
.seg.on, .seg button.on { color: var(--ink); }

.notice-list { display: flex; flex-direction: column; gap: 10px; }
.notice { background: #fffaf2; border-radius: 16px; padding: 12px 16px; border: 1.5px solid #f6e7cf; }
.notice header { display: flex; justify-content: space-between; gap: 12px; }
.notice p { margin: 6px 0 0; font-size: 14px; }
.menu-list { display: flex; flex-direction: column; gap: 4px; }
.menu-item-row { border: 0; background: transparent; text-align: left; padding: 12px 12px; border-radius: 12px; font-weight: 700; }
.menu-item-row:hover { background: #fff3ea; }
.me-card { display: flex; gap: 12px; align-items: center; padding: 4px 6px 12px; border-bottom: 1.5px solid var(--line); margin-bottom: 6px; }

.plain { list-style: none; padding: 0; margin: 0; }
.admin-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.now-playing { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: #f4f0ff; border-radius: 16px; padding: 12px 14px; }
.now-playing > div:first-child { display: flex; flex-direction: column; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; color: var(--muted); font-weight: 800; padding: 6px 8px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table .num { text-align: right; white-space: nowrap; }
.table.report td.num { min-width: 42px; }
.npc-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.npc-card { display: flex; gap: 10px; background: #fbf6f1; border-radius: 16px; padding: 10px 12px; }
.npc-card p { margin: 2px 0 0; }
.npc-emoji { width: 42px; height: 42px; flex: none; border-radius: 14px; background: #fff; display: grid; place-items: center; color: var(--primary); }
.npc-emoji .ic { width: 26px; height: 26px; }

#toasts { position: fixed; top: calc(70px + var(--safe-t)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 60; pointer-events: none; width: max-content; max-width: calc(100% - 24px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 16px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; opacity: 0; transform: translateY(-10px); transition: all .25s; }
.toast.in { opacity: 1; transform: none; }
.toast.big { background: linear-gradient(135deg, #ff7a59, #ff9db0); font-size: 17px; padding: 14px 22px; }
.toast .btn { background: rgba(255, 255, 255, .18); color: #fff; }
.ticon { display: grid; place-items: center; }
.ticon .ic { width: 20px; height: 20px; }


/* ── 그린 아이콘 ── */
.ic { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.22em; overflow: visible; }
.ic .d { fill: currentColor; stroke: none; opacity: .2; }
.ic .f { fill: currentColor; stroke: none; }
.icon-btn { position: relative; color: #4a4152; }
.icon-btn .ic { width: 22px; height: 22px; }
.icon-btn.sm .ic { width: 17px; height: 17px; }
.icon-btn.active { color: var(--primary); }
.icon-btn .count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--primary); color: #fff; font: 800 11px/18px var(--font); text-align: center; box-shadow: 0 0 0 2px #fff; }
.btn .ic { width: 1.15em; height: 1.15em; }
.btn.icon-only { padding: 7px 9px; }
.btn.icon-only .ic { width: 18px; height: 18px; }
.with-ic { display: inline-flex; align-items: center; gap: 6px; }
.modal-head h2 { display: flex; align-items: center; gap: 8px; }
.modal-head h2 .title-ic { width: 24px; height: 24px; color: var(--primary); }
.tab { display: inline-flex; align-items: center; gap: 6px; }
.tab .ic { width: 17px; height: 17px; }
.banner-text .ic { color: #d99a00; margin-right: 4px; }
.notice header b .ic, .admin-row b .ic { color: #d99a00; margin-right: 4px; }
.menu-item-row { display: flex; align-items: center; gap: 12px; }
.menu-item-row .ic { width: 20px; height: 20px; color: var(--primary); }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); font-weight: 700; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }
kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: #fff; color: var(--ink); font: 800 12px/1 var(--font); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18); }

/* 접속 알약 */
.pill { display: inline-flex; align-items: center; gap: 6px; }
.pill .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ecf8e; box-shadow: 0 0 0 3px rgba(62, 207, 142, .22); }
.pill .sep { width: 1px; height: 12px; background: var(--line); margin: 0 2px; }
.pill .ic { width: 15px; height: 15px; color: #ff8a3d; }

/* 채팅: 지금 누구에게 보이는지 */
.chat-head b { display: inline-flex; align-items: center; gap: 6px; }
.chat-head b .ic { color: var(--primary); }
.chat-head .chev .ic { width: 18px; height: 18px; color: var(--muted); }
.chat-scope { display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 12px; font-weight: 800; color: var(--muted); background: #f6efe8; border: 0; border-radius: 999px; padding: 3px 7px 3px 7px; white-space: nowrap; cursor: pointer; }
.chat-scope:hover { filter: brightness(.97); }
.chat-scope .ic:last-child { width: 12px; height: 12px; opacity: .7; }
.chat-scope .ic { width: 14px; height: 14px; }
.chat.in-room { box-shadow: 0 0 0 2.5px var(--room), var(--shadow); }
.chat.in-room .chat-scope { background: var(--room); color: #fff; }
.chat.in-room .chat-head b .ic { color: var(--room); }
.msg.system { align-self: center; font-size: 12px; color: var(--muted); background: #f6efe8; border-radius: 999px; padding: 1px 10px; margin: 2px 0; }
.msg.system time { display: none; }
.chat-form .send { padding: 7px 12px; }
.chat-form .send .ic { width: 18px; height: 18px; }
.chat-form .input::placeholder { font-size: 12.5px; }

/* 아래 막대 */
.seg button .ic { width: 17px; height: 17px; }
.seg button.on .ic { color: var(--c, var(--primary)); }
.focus-wrap { position: relative; display: flex; align-items: center; }
.focus-wrap > .ic { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.focus-wrap .focus-input { padding-left: 32px; }
.emote-wrap .icon-btn .ic { color: #e0a100; }

/* 상호작용 칩: E 키 */
.chip-btn { display: inline-flex; align-items: center; gap: 7px; }
.chip-btn .ic { width: 17px; height: 17px; }
.chip-btn.main { background: var(--primary); padding: 7px 16px 7px 8px; }
.chip-btn.main:hover { background: #ff6a45; }
.chip-btn.main kbd { color: var(--primary); }
.chip-btn:not(:has(kbd)).main { padding-left: 14px; }

/* 오늘 할 일 */
.todo-panel { position: absolute; left: 12px; top: calc(62px + var(--safe-t)); width: 300px; max-height: calc(100% - 62px - 84px - 42vh - 30px - var(--safe-t) - var(--safe-b)); min-height: 180px; display: flex; flex-direction: column; background: rgba(255, 255, 255, 0.96); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 4; overflow: hidden; backdrop-filter: blur(6px); animation: pop .2s ease-out; }
.todo-panel header { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 14px; }
.todo-panel header b { display: inline-flex; align-items: center; gap: 6px; }
.todo-panel header b .ic { color: var(--primary); }
.todo-panel header .icon-btn { margin-left: auto; }
.todo-prog { display: flex; align-items: center; gap: 8px; padding: 0 14px 6px; font-size: 12px; color: var(--muted); }
.todo-prog:empty { display: none; }
.todo-prog .bar { flex: 1; height: 6px; border-radius: 3px; background: #f3e9df; overflow: hidden; }
.todo-prog .bar i { display: block; height: 100%; background: linear-gradient(90deg, #7fd1b9, #3ecf8e); border-radius: 3px; transition: width .35s; }
.todo-list { list-style: none; margin: 0; padding: 2px 8px; overflow-y: auto; flex: 1; }
.todo { display: flex; align-items: center; gap: 8px; padding: 6px 4px 6px 6px; border-radius: 12px; }
.todo:hover { background: #fff6ee; }
.todo-check { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 2px solid #d9cdbf; background: #fff; display: grid; place-items: center; padding: 0; color: transparent; transition: all .15s; }
.todo-check .ic { width: 15px; height: 15px; stroke-width: 3; }
.todo-check:hover { border-color: #3ecf8e; color: #bfe9d6; }
.todo.done .todo-check { background: #3ecf8e; border-color: #3ecf8e; color: #fff; }
.todo-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.4; word-break: break-word; cursor: text; text-decoration: line-through 2px transparent; transition: text-decoration-color .3s, color .2s; }
.todo.done .todo-text { color: var(--muted); text-decoration-color: #a99fb3; }
.todo-edit { flex: 1; padding: 4px 8px; border-radius: 8px; font-size: 14px; }
.todo-act { flex: none; border: 0; background: transparent; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: #b8aec2; padding: 0; opacity: 0; transition: opacity .15s; }
.todo:hover .todo-act, .todo-act:focus-visible { opacity: 1; }
.todo-act:hover { background: #fff; color: var(--primary); }
.todo-act .ic { width: 16px; height: 16px; }
.todo-empty { color: var(--muted); font-size: 13px; padding: 10px 8px; }
.todo-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.todo-form .input { padding: 8px 12px; border-radius: 12px; font-size: 14px; }

/* 사용법 */
.help-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; }
.help-list li { display: flex; gap: 12px; align-items: flex-start; }
.help-ic { flex: none; width: 36px; height: 36px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.help-ic .ic { width: 20px; height: 20px; }
.help-list b { font-size: 14px; }
.help-list p { margin: 1px 0 0; font-size: 13.5px; color: #6d6475; }

/* 랭킹 1~3위 */
.rk.top { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 900; font-size: 13px; }
.rk.top1 { background: linear-gradient(135deg, #ffd45a, #f0a500); }
.rk.top2 { background: linear-gradient(135deg, #d9dee7, #a7b0bf); }
.rk.top3 { background: linear-gradient(135deg, #f2b98b, #c97f4a); }

/* ── 좁은 화면 (휴대폰) ── */
@media (max-width: 720px) {
  .brand b, .pill { display: none; }
  .topbar .icon-btn { width: 38px; height: 38px; }
  .chat { width: calc(100% - 76px); bottom: calc(128px + var(--safe-b)); max-height: 36vh; }
  .chat.collapsed { width: auto; }
  .dock { left: 12px; right: 12px; transform: none; flex-wrap: wrap; justify-content: space-between; gap: 6px; border-radius: 20px; }
  .focus-wrap { order: 3; flex: 1 1 100%; }
  .focus-input { width: 100%; }
  .seg button em { display: none; }
  .seg button { padding: 8px 11px; font-size: 16px; }
  .quick { bottom: calc(128px + var(--safe-b)); }
  .quick .icon-btn { width: 40px; height: 40px; }
  .chips-float { bottom: calc(130px + var(--safe-b)); max-width: calc(100% - 80px); left: 12px; transform: none; justify-content: flex-start; }
  .music-card { left: 12px; right: 12px; width: auto; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .rank li { grid-template-columns: 28px 36px 1fr 70px; }
  .rank .bar-wrap { display: none; }
  .stats-head { flex-wrap: wrap; }
  .today-box { margin-left: 0; }
  .menu-grid { grid-template-columns: 1fr; }
  .npc-cards { grid-template-columns: 1fr; }
  .modal.side { top: auto; height: 58vh; left: 8px; right: 8px; bottom: 8px; width: auto; }
}

@media (max-width: 720px) {
  .seg button .ic { width: 19px; height: 19px; }
  .todo-panel { left: 12px; right: 12px; width: auto; max-height: 46vh; }
  .todo-act { opacity: 1; }
  .chat-scope { font-size: 11px; }
  .chip-btn.main { padding-left: 14px; }
  /* 접힌 채팅 단추 위로, 펼친 채팅이면 그 위로 */
  .chips-float { bottom: calc(182px + var(--safe-b)); }
  .chat:not(.collapsed) ~ .chips-float { bottom: calc(138px + 36vh + var(--safe-b)); }
}
@media (max-width: 1100px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .features { grid-template-columns: 1fr; } }

/* ── 입주사 · 탕비실 ── */
.ent .tag small.co { color: #fff; background: #3d6bd6; font-weight: 800; font-size: 9.5px; letter-spacing: .02em; padding: 1px 6px; border-radius: 999px; margin-left: 1px; }
.co-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 9px 2px 7px; border-radius: 999px; background: #e8eef8; color: #3d6bd6; font-size: 12px; font-weight: 800; vertical-align: middle; }
.co-badge .ic { width: 14px; height: 14px; }
.menu-item .cup.bottle { width: 30px; margin: 0 5px; border-radius: 10px 10px 8px 8px; background: linear-gradient(#ffffff 0 18%, var(--c) 18% 100%); }
.menu-item .cup.bottle::after { left: 7px; right: 7px; top: -7px; height: 9px; border-radius: 3px; background: #9ad3c4; }
.menu-item .cup.snack { width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.55) 0 18%, transparent 19%), var(--c); box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); }
.menu-item .cup.snack::after { display: none; }
select.input.sm { width: auto; padding: 4px 8px; font-size: 12.5px; border-radius: 8px; }

/* ── 귓속말 · 채팅창 투명도 ── */
.chat { position: absolute; backdrop-filter: blur(calc(var(--chat-a) * 7px)); -webkit-backdrop-filter: blur(calc(var(--chat-a) * 7px)); }
.chat .chat-form { background: rgba(255, 255, 255, calc(var(--chat-a) * .6)); }
.chat.see-through .msg:not(.system):not(.announce):not(.whisper) { text-shadow: 0 0 3px #fff, 0 0 6px #fff, 0 0 10px rgba(255, 255, 255, .9); }
.chat.see-through .msg time { color: #8f8698; }
.chat-alpha { margin-left: auto; width: 28px; height: 28px; border-radius: 9px; background: transparent; border: 0; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; }
.chat-alpha:hover { background: rgba(0, 0, 0, .05); }
.chat-alpha .ic { width: 17px; height: 17px; }
.chat-alpha + .chev { margin-left: 0; }
.chat.collapsed .chat-alpha { display: none; }
.chat.collapsed .chev { margin-left: auto; }
.chat-pop { position: absolute; left: 10px; right: 10px; top: 46px; z-index: 5; background: #fff; border-radius: 16px; box-shadow: 0 10px 30px rgba(60, 40, 30, .22); padding: 10px; display: flex; flex-direction: column; gap: 4px; max-height: calc(100% - 56px); overflow-y: auto; }
.chat-pop.hidden { display: none; }
.pop-title { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13px; padding: 2px 4px 6px; }
.pop-title .ic { width: 16px; height: 16px; color: var(--primary); }
.pop-title b { margin-left: auto; color: var(--primary); font-variant-numeric: tabular-nums; }
.pop-sub { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 800; color: #8a6bd8; padding: 8px 4px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.pop-sub .ic { width: 14px; height: 14px; }
.pop-list { display: flex; flex-direction: column; gap: 2px; }
.pop-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; font: inherit; font-size: 13.5px; background: transparent; border: 0; border-radius: 10px; padding: 7px 9px; cursor: pointer; color: var(--ink); }
.pop-item:hover { background: #f8f3ee; }
.pop-item.on { background: #f1ecff; color: #5a3fc4; font-weight: 800; }
.pop-item .ic { width: 17px; height: 17px; color: var(--muted); }
.pop-item .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin: 0 4px; }
.pop-item small { margin-left: auto; color: var(--muted); font-size: 11px; }
.pop-empty { padding: 4px 8px 6px; margin: 0; }
.alpha-row { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.alpha-row input { flex: 1; accent-color: var(--primary); }
.alpha-row small { color: var(--muted); font-size: 11px; }
.chat-pop p.small { margin: 4px 6px 2px; }
.msg.whisper { display: block; background: #f3eeff; border-radius: 10px; padding: 3px 8px; color: #4b3a7a; cursor: pointer; }
.msg.whisper:hover { background: #ebe3ff; }
.msg.whisper > .ic { width: 13px; height: 13px; color: #8a6bd8; vertical-align: -2px; margin-right: 4px; }
.msg.whisper .who { color: #7253d6; cursor: pointer; }
.msg.whisper.mine { background: #f7f3ff; }
.whisper-chip { display: inline-flex; align-items: center; gap: 4px; flex: none; max-width: 42%; border: 0; font: inherit; font-size: 12.5px; font-weight: 800; color: #fff; background: #8a6bd8; border-radius: 10px; padding: 0 8px; cursor: pointer; }
.whisper-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whisper-chip .ic { width: 14px; height: 14px; flex: none; }
.whisper-chip .ic:last-child { width: 12px; height: 12px; opacity: .8; }
.whisper-chip.hidden { display: none; }
.chat.whispering { box-shadow: 0 0 0 2.5px #8a6bd8, var(--shadow); }
.chat.whispering .chat-form .input { border-color: #cbbcf2; }

/* ── 광고판 ── */
.ad-editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
@media (max-width: 760px) { .ad-editor { grid-template-columns: 1fr; } }
.ad-opts { gap: 10px; align-items: center; }
.mini-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.mini-field .input { width: auto; padding: 6px 10px; border-radius: 10px; }
.mini-field .sm-num { width: 70px; }
.color-in { width: 40px; height: 32px; border: 1.5px solid var(--line); border-radius: 10px; padding: 2px; background: #fff; cursor: pointer; }
.ad-preview-wrap { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; }
.ad-preview { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 6px #3a3f4d, 0 6px 18px rgba(0, 0, 0, .18); margin: 6px; display: grid; place-items: center; }
.ad-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ad-preview-text { position: relative; text-align: center; padding: 10px 16px; display: flex; flex-direction: column; gap: 4px; color: #3a3340; }
.ad-preview-text b { font-size: 19px; line-height: 1.25; word-break: keep-all; }
.ad-preview-text span { font-size: 12px; opacity: .85; white-space: pre-line; }
.ad-preview-text.on-img { align-self: end; justify-self: stretch; text-align: left; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); padding-top: 28px; text-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.ad-badge { position: absolute; left: 8px; top: 8px; font-style: normal; font-size: 10px; font-weight: 800; color: #fff; background: rgba(0, 0, 0, .45); border-radius: 5px; padding: 1px 6px; }
.ad-row { align-items: center; gap: 12px; }
.ad-thumb { flex: none; width: 88px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; display: grid; place-items: center; color: #3a3340; font-size: 13px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.ad-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ad-meta { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.ad-meta small { flex-basis: 100%; }
.ad-state { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 8px; }
.ad-state.on { background: #dff5e1; color: #2f8a4b; }
.ad-state.wait { background: #e3ecfb; color: #3d6bd6; }
.ad-state.done, .ad-state.off { background: #f1ece6; color: #8a8090; }
.icon-btn.sm[disabled] { opacity: .35; pointer-events: none; }
.ad-view { display: flex; flex-direction: column; gap: 12px; }
.ad-img { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 14px; background: #f6efe8; }
.ad-color { aspect-ratio: 16 / 9; border-radius: 14px; display: grid; place-items: center; text-align: center; padding: 24px; font-size: 26px; color: #3a3340; }
.ad-body { white-space: pre-line; margin: 0; line-height: 1.6; }
.ad-tag { margin-right: auto; font-weight: 700; }

/* ── 언어 바꾸기 ── */
#landing { position: relative; }
.lang-switch { position: absolute; top: 14px; right: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 800; color: var(--ink); background: rgba(255, 255, 255, .85); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px 6px 9px; cursor: pointer; box-shadow: 0 2px 8px rgba(60, 40, 30, .08); }
.lang-switch:hover { background: #fff; }
.lang-switch .ic { width: 16px; height: 16px; color: var(--primary); }

/* 화면 돌리기 · 셀카 */
.world-canvas.rotating { cursor: grabbing; }
.compass .needle { transform-origin: 12px 12px; transform: rotate(var(--rot, 0rad)); }
.compass.turned { box-shadow: 0 0 0 2px var(--primary) inset, var(--shadow); }
.flash { position: absolute; inset: 0; background: #fff; pointer-events: none; z-index: 40; animation: flash-out .7s ease-out forwards; }
@keyframes flash-out { from { opacity: .92; } to { opacity: 0; } }
.modal.selfie-modal { width: min(640px, 100%); }
.selfie-view img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 8px 24px rgba(60, 30, 20, .18); margin-bottom: 14px; }
@media (max-height: 620px) { .quick .zoom { display: none; } }

/* 휴대폰 방향키: 터치 화면에서만. 접힌 채팅 단추 위, 왼쪽 아래 */
.dpad { display: none; position: absolute; left: 12px; bottom: calc(140px + var(--safe-b)); width: 132px; height: 132px; z-index: 3; border-radius: 50%; background: rgba(255, 255, 255, 0.5); box-shadow: var(--shadow); backdrop-filter: blur(4px); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.dpad.held { background: rgba(255, 255, 255, 0.72); }
.dpad .dp { position: absolute; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: rgba(255, 255, 255, 0.95); color: var(--ink, #3a3340); box-shadow: 0 2px 6px rgba(60, 30, 20, 0.14); transition: background .08s, color .08s, transform .08s; pointer-events: none; }
.dpad .dp .ic { width: 24px; height: 24px; stroke-width: 2.6; }
.dpad .dp-up { left: 44px; top: 4px; }
.dpad .dp-down { left: 44px; bottom: 4px; }
.dpad .dp-left { left: 4px; top: 44px; }
.dpad .dp-right { right: 4px; top: 44px; }
.dpad .dp-right .ic { transform: rotate(90deg); }
.dpad .dp-down .ic { transform: rotate(180deg); }
.dpad .dp-left .ic { transform: rotate(-90deg); }
.dpad .dp.on { background: var(--primary); color: #fff; transform: scale(0.94); }
.dpad .dp-c { position: absolute; left: 56px; top: 56px; width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, 0.85); pointer-events: none; }
@media (pointer: coarse) {
  .dpad { display: block; }
  /* 행동 단추(앉기 · 주문 …)는 방향키 오른쪽에 */
  .chips-float { left: 154px; transform: none; justify-content: flex-start; max-width: calc(100% - 154px - 64px); }
  .chat:not(.collapsed) ~ .dpad { display: none; }
  .chat:not(.collapsed) ~ .chips-float { left: 12px; max-width: calc(100% - 80px); }
}
@media (pointer: coarse) and (max-width: 720px) {
  .dpad { bottom: calc(184px + var(--safe-b)); }
  .chips-float { bottom: calc(184px + var(--safe-b)); }
  /* 펼친 채팅 위로 올린다 */
  .chat:not(.collapsed) ~ .dpad { display: block; bottom: calc(138px + 36vh + var(--safe-b)); }
  .chat:not(.collapsed) ~ .chips-float { left: 154px; max-width: calc(100% - 154px - 64px); }
}

/* 메모 보드 */
.modal.memo-modal { width: min(560px, 100%); }
.memo-sub { margin: 0 0 12px; font-size: 13.5px; }
.memo-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.memo-input { width: 100%; resize: vertical; min-height: 78px; border: 0; border-radius: 14px; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(58, 51, 64, .12), 0 2px 8px rgba(60, 30, 20, .08); transition: background .15s; }
.memo-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--primary), 0 2px 8px rgba(60, 30, 20, .08); }
.memo-form-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.memo-colors { display: flex; gap: 8px; }
.memo-swatch { width: 28px; height: 28px; border-radius: 9px; border: 0; box-shadow: inset 0 0 0 1.5px rgba(58, 51, 64, .15); cursor: pointer; transition: transform .1s; }
.memo-swatch.on { box-shadow: 0 0 0 2.5px #fff, 0 0 0 4.5px var(--primary); transform: scale(1.06); }
.memo-private { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; }
.memo-private input { width: 17px; height: 17px; accent-color: var(--primary); }
.memo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.memo-card { --c: #ffe58a; position: relative; background: var(--c); border-radius: 4px 4px 14px 4px; padding: 16px 12px 10px; box-shadow: 0 6px 14px rgba(60, 30, 20, .14); display: flex; flex-direction: column; gap: 8px; min-height: 110px; }
.memo-card:nth-child(3n+1) { transform: rotate(-.8deg); }
.memo-card:nth-child(3n+2) { transform: rotate(.6deg); }
.memo-card::before { content: ''; position: absolute; top: 5px; left: 50%; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: #e0533d; box-shadow: inset -2px -2px 0 rgba(0, 0, 0, .15); }
.memo-text { margin: 0; flex: 1; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.memo-card.hidden .memo-text { color: #7a7080; font-size: 13px; }
.memo-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6b6275; }
.memo-meta b { color: var(--ink); min-width: 0; max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-meta time { flex: 1; white-space: nowrap; }
.memo-meta .icon-btn.sm { width: 26px; height: 26px; margin: -4px -4px -4px 0; }
.memo-lock .ic { width: 14px; height: 14px; }
.memo-empty { grid-column: 1 / -1; text-align: center; padding: 18px 0; }

/* 실내 스쿠터 버튼: 잠겨 있으면 오늘 집중한 만큼 아래 막대가 찬다 · 열리면 점 · 타는 중이면 칠한다 */
.icon-btn.scooter.locked .ic { opacity: .45; }
.icon-btn.scooter.locked::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: 5px; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, var(--primary) calc(var(--p, 0) * 100%), rgba(58, 51, 64, .14) 0); }
.icon-btn.scooter:not(.locked):not(.on)::after { content: ''; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px #fff; }
.icon-btn.scooter.on { background: var(--primary); color: #fff; }

/* ── 지점 ── */
.branch-pill { display: inline-flex; align-items: center; gap: 6px; border: 0; color: var(--ink); cursor: pointer; }
.branch-pill svg { width: 17px; height: 17px; color: #e0795b; }
.branch-pill span { max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.branch-list { display: flex; flex-direction: column; gap: 8px; }
.branch-row { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); background: #fff; border-radius: 14px; padding: 11px 14px; font-size: 15px; text-align: left; cursor: pointer; }
.branch-row:hover:not(:disabled) { border-color: #ffc2ad; background: #fffaf6; }
.branch-row svg { width: 20px; height: 20px; color: #e0795b; flex: none; }
.branch-row b { flex: 1; }
.branch-row.on { border-color: var(--primary); background: var(--primary-soft); cursor: default; }
.branch-card { border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.branch-card.main { background: #fffaf3; }
.branch-card p { margin: 0; }
.branch-card-head { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.branch-card-head svg { width: 18px; height: 18px; color: #e0795b; }
.access-list { margin-top: 10px; max-height: 55vh; overflow: auto; }
.seg.sm button { padding: 5px 9px; font-size: 12px; }
.access-chips { display: flex; flex-wrap: wrap; gap: 4px; min-width: 150px; }
.chip.sm { padding: 3px 8px 3px 6px; font-size: 12px; display: inline-flex; align-items: center; gap: 3px; }
.chip.sm svg { width: 13px; height: 13px; }
.chip.yes { color: #2f7d4a; }
.chip.no { color: #b8454a; background: #fff4f3; }
.chip.set { border-color: currentColor; }
.chip:disabled { opacity: .55; cursor: default; }

/* 지점 배치 편집기 */
.modal.branch-editor { width: min(1180px, 100%); height: calc(100vh - 52px); height: calc(100dvh - 52px); }
.branch-editor .modal-body { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.be-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 16px; min-height: 0; flex: 1; }
.be-side { display: flex; flex-direction: column; gap: 10px; overflow: auto; padding-right: 4px; }
.be-side .row > .field { flex: 1; min-width: 0; }
.be-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.mix { border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 12px; }
.mix summary { cursor: pointer; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.mix summary svg { width: 18px; height: 18px; color: #e0a030; }
.mix p { margin: 6px 0; }
.mix-grid { display: grid; grid-template-columns: 1fr; gap: 5px; margin-bottom: 8px; }
.mix-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.mix-row .input { width: 96px; flex: none; }
.mix .btn { margin-top: 8px; width: 100%; justify-content: center; }
.palette-wrap { display: flex; align-items: center; gap: 8px; }
.palette { display: flex; flex-wrap: wrap; gap: 5px; }
.palette .chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 7px; font-size: 12.5px; }
.pe-dot { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .15); flex: none; }
.plan-wrap { flex: 1 1 0; min-height: 220px; background: #fbf7f1; border-radius: 14px; border: 1.5px solid var(--line); position: relative; }
.plan { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; user-select: none; }
.plan .pe-g1 { stroke: rgba(150, 120, 90, .12); stroke-width: .02; }
.plan .pe-g5 { stroke: rgba(150, 120, 90, .3); stroke-width: .035; }
.plan .pe-wall { fill: none; stroke: #7d6a5c; stroke-width: .25; stroke-linecap: square; }
.plan .pe-wall.pe-low { stroke: #c4ad98; stroke-width: .18; }
.plan .pe-ent { stroke: #e7a08a; stroke-width: .05; stroke-dasharray: .2 .15; }
.plan .pe-hatch { stroke: rgba(224, 121, 91, .35); stroke-width: .12; }
.plan .pe-label { fill: #a5877a; font-weight: 800; }
.plan .pe-item { cursor: grab; }
.plan .pe-item rect { fill-opacity: .55; stroke: rgba(80, 60, 50, .35); stroke-width: .05; }
.plan .pe-item text { fill: #4a3f46; font-weight: 800; pointer-events: none; }
.plan .pe-item.pe-sel rect { fill-opacity: .8; stroke: var(--primary); stroke-width: .14; }
.plan .pe-item.pe-bad rect { stroke: #e0574a; stroke-width: .14; stroke-dasharray: .3 .18; }
.plan .pe-ob { fill: rgba(90, 70, 60, .42); pointer-events: none; }
.plan .pe-ob.pe-tall { fill: rgba(70, 55, 50, .62); }
.plan .pe-seat { fill: #fff; stroke: #8a7768; stroke-width: .05; pointer-events: none; }
.inspector { min-height: 40px; display: flex; flex-direction: column; gap: 6px; }
.inspector p { margin: 0; }
.insp-head { display: flex; align-items: center; gap: 6px; }
.inspector .input.sm { width: 150px; flex: none; }
.pe-swatches { display: flex; gap: 5px; }
.pe-sw { width: 24px; height: 24px; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; padding: 0; }
.pe-sw.on { box-shadow: 0 0 0 2.5px var(--ink); }
.be-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-top: 1.5px solid var(--line); padding-top: 8px; }
.be-foot p { margin: 0 0 4px; }
.problems { display: flex; flex-direction: column; gap: 3px; }
.problem { display: inline-flex; align-items: center; gap: 6px; border: 0; background: #fff1ef; color: #b8454a; border-radius: 10px; padding: 4px 10px; font-size: 13px; font-weight: 700; text-align: left; cursor: pointer; }
.problem svg, .problems .ok svg { width: 15px; height: 15px; flex: none; }
.problems .ok { display: inline-flex; align-items: center; gap: 6px; color: #2f7d4a; margin: 0; font-weight: 700; }
@media (max-width: 820px) {
  .modal.branch-editor { height: auto; }
  .branch-editor .modal-body { overflow: auto; }
  .be-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .be-side { overflow: visible; }
  .plan-wrap { flex: none; height: 62vw; min-height: 260px; }
}
