:root {
  --cream: rgba(255, 249, 230, 0.94);
  --ink: #5a4632;
  --ink-soft: #9a8468;
  --line: rgba(90, 70, 50, 0.16);
  --accent: #19c8b9;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body.editing .play-ui { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #bfe9ff;
  color: var(--ink);
  font-family: "Jua", system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif;
  font-size: 15px;
}
button, input { font: inherit; color: inherit; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#labels {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.label {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  will-change: transform;
}
.label .bubble {
  max-width: 230px;
  padding: 7px 14px;
  border-radius: 18px;
  background: #fffbea;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.3;
  word-break: break-word;
  box-shadow: 0 2px 0 rgba(90, 70, 50, 0.18);
}
.label .name {
  font-size: 14px;
  color: #fff;
  text-shadow: 0 0 3px #3b2c1c, 0 0 3px #3b2c1c, 0 1px 2px #3b2c1c;
  white-space: nowrap;
}
.label.me .name { color: #ffe566; }

/* 아바타 만들기 */
#editor {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(440px, 100vw);
  padding: 36px 32px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--cream);
}
#editor h1 { margin: 0; font-size: 32px; font-weight: 400; }
.field {
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--ink);
  font-size: 20px;
}
.field span { color: var(--ink-soft); padding-right: 4px; }
.field input {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  outline: 0;
  background: transparent;
}
#options { display: flex; flex-direction: column; gap: 16px; }
.opt-title { color: var(--ink-soft); font-size: 14px; margin-bottom: 8px; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.opt-row.thumbs { gap: 6px; }
.opt-row .thumb {
  width: 68px;
  height: 68px;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 16px;
  background: rgba(90, 70, 50, 0.07);
  cursor: pointer;
}
.opt-row .thumb img { width: 100%; height: 100%; display: block; }
.opt-row .thumb[aria-checked="true"] { border-color: var(--accent); background: #fff; }
.opt-row .swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  outline-offset: 3px;
}
.opt-row .swatch[aria-checked="true"] { outline: 3px solid var(--ink); }
.opt-row .swatch.orig {
  border: 2px solid var(--ink-soft);
  background: linear-gradient(135deg, transparent 45%, var(--ink-soft) 45%, var(--ink-soft) 55%, transparent 55%), #fff;
}
.opt-row .chip {
  padding: 2px 0;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}
.opt-row .chip[aria-checked="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.actions { display: flex; gap: 10px; margin-top: auto; padding-top: 8px; }
.actions button {
  padding: 12px 20px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: none;
  cursor: pointer;
}
.actions button[type="submit"] { flex: 1; border-color: var(--accent); background: var(--accent); color: #fff; font-size: 18px; }

/* 플레이 화면 */
#edit-avatar, #sound-btn, #card-btn, #tp-btn, #emotes button {
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--cream);
  cursor: pointer;
}
#edit-avatar { position: fixed; top: 16px; left: 16px; }
#sound-btn { position: fixed; top: 16px; left: 132px; }
#card-btn { position: fixed; top: 16px; left: 236px; }
#edit-avatar:hover, #emotes button:hover { background: #fff; }

#online {
  position: fixed;
  top: 16px;
  right: 16px;
  min-width: 170px;
  max-height: 45vh;
  overflow-y: auto;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--cream);
}
#online-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
#online-count { color: var(--ink-soft); font-size: 13px; }
#ch-btn { padding: 3px 10px; border: 0; border-radius: 999px; background: #2f6b4a; color: #fff; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
#ch-btn:hover { background: #3a8059; }
#ch-menu { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 10px; padding: 8px; border-radius: 12px; background: #fff7e8; }
#ch-menu .ch-note { margin: 0 0 4px; color: var(--ink-soft); font-size: 12px; }
#ch-menu .ch-item { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border: 0; border-radius: 8px; background: #fff; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
#ch-menu .ch-item:not(:disabled):hover { background: #e8f4ec; }
#ch-menu .ch-item:disabled { cursor: default; opacity: 0.6; }
#ch-menu .ch-item.here { opacity: 1; background: #e8f4ec; font-weight: 700; }
#ch-menu .ch-n { color: var(--ink-soft); font-size: 13px; }
#ch-menu .ch-new, #ch-menu .ch-copy { justify-content: center; color: #2f6b4a; font-size: 13px; }
#booth-meet { margin: 0 0 8px; padding: 6px 14px; border: 0; border-radius: 999px; background: #2f6b4a; color: #fff; font: inherit; font-size: 13px; cursor: pointer; }
#online-list { list-style: none; margin: 0; padding: 0; }
#online-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
#online-list .score { color: #d79a00; font-size: 14px; }
#online-list button { padding: 3px 0; border: 0; background: none; cursor: pointer; }
#online-list button:disabled { cursor: default; }
#online-list button:not(:disabled):hover { text-decoration: underline; }

#chat {
  position: fixed;
  left: 16px;
  bottom: 16px;
  width: min(380px, calc(100vw - 32px));
  height: min(300px, 40vh);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: var(--cream);
}
#tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 2px solid var(--line);
  scrollbar-width: none;
}
#tabs .tab {
  display: flex;
  align-items: center;
  flex: none;
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
}
#tabs .tab.active { color: var(--ink); border-bottom-color: var(--accent); }
#tabs .tab button { padding: 10px 4px 7px 16px; border: 0; background: none; cursor: pointer; }
#tabs .tab button.close { padding: 10px 12px 7px 2px; opacity: 0.6; }
#tabs .tab:first-child button { padding-right: 16px; }
#tabs .unread { color: #e0453f; margin-left: 4px; }
#log {
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px;
  line-height: 1.5;
  word-break: break-word;
}
#log .m .who { margin-right: 6px; }
#log .m .time { color: var(--ink-soft); font-size: 12px; margin-left: 6px; }
#log .sys { color: var(--ink-soft); font-size: 13px; }
#send { display: flex; border-top: 2px solid var(--line); }
#send input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 0;
  outline: 0;
  background: transparent;
}
#send input::placeholder { color: var(--ink-soft); }
#send button { padding: 0 18px; border: 0; background: none; color: var(--accent); cursor: pointer; }

#emotes {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  gap: 8px;
}
#emotes kbd { font: inherit; color: var(--ink-soft); margin-right: 3px; }

/* 입장 인증 */
#gate:empty { display: none; }
#gate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(25, 200, 185, 0.1);
  line-height: 1.45;
}
#gate p { margin: 0; }
#gate .muted { color: var(--ink-soft); font-size: 13px; }
#gate .err { color: #e0453f; font-size: 14px; }
#gate .ok { color: #0f9488; }
#gate ol { margin: 0; padding-left: 20px; }
#gate li { margin: 4px 0; }
#gate code {
  padding: 1px 8px;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 0.06em;
}
#gate input {
  padding: 9px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: #fff;
}
#gate input:focus { border-color: var(--accent); }
.gate-row { display: flex; flex-wrap: wrap; gap: 8px; }
.gate-row a, .gate-row button, .linkish {
  padding: 8px 16px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: #fff;
  color: #0f9488;
  text-decoration: none;
  cursor: pointer;
}
.gate-row a.primary { background: var(--accent); color: #fff; }
.linkish { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--ink-soft); text-decoration: underline; }
.field input:disabled { color: var(--ink); opacity: 1; }
.badge-v { color: #19c8b9; margin-left: 3px; }

/* 프로필 카드 */
#profile {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(320px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 20px 20px;
  border-radius: 24px;
  background: rgba(255, 249, 230, 0.98);
  box-shadow: 0 6px 0 rgba(90, 70, 50, 0.16);
}
#profile-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 22px;
  cursor: pointer;
}
#profile-img { width: 96px; height: 96px; border-radius: 22px; background: rgba(90, 70, 50, 0.07); }
#profile-name { font-size: 20px; }
#profile-badge { color: var(--ink-soft); font-size: 13px; }
.profile-actions { display: flex; flex-direction: column; align-self: stretch; gap: 8px; margin-top: 8px; }
.profile-actions a, .profile-actions button {
  padding: 10px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: #fff;
  color: #0f9488;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
#profile-follow { background: var(--accent); color: #fff; }
.profile-sub { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.profile-sub button {
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 14px;
  cursor: pointer;
}
.profile-sub button:hover, .profile-sub button.armed { color: #e0453f; }
#report-reasons { align-self: stretch; text-align: center; }
#report-reasons p { margin: 6px 0; color: var(--ink-soft); font-size: 13px; }
.reason-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.reason-row button {
  padding: 6px 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}
.reason-row button:hover { border-color: #e0453f; color: #e0453f; }

/* 처음 안내 */
#tips {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  width: min(380px, calc(100vw - 32px));
  padding: 24px 26px 22px;
  border-radius: 24px;
  background: rgba(255, 249, 230, 0.98);
  box-shadow: 0 6px 0 rgba(90, 70, 50, 0.16);
}
#tips h2 { margin: 0 0 12px; font-size: 22px; font-weight: 400; }
#tips ul { margin: 0 0 16px; padding: 0; list-style: none; line-height: 1.5; }
#tips li { padding: 4px 0; }
#tips b { display: inline-block; min-width: 56px; font-weight: 400; color: #0f9488; }
#tips-close {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
}
.post-actions .share { margin-left: auto; padding: 4px 0; color: #0f9488; text-decoration: none; }
.post-actions .share:hover { text-decoration: underline; }

/* 게시판 */
.label.sign .name {
  padding: 5px 12px;
  border-radius: 999px;
  background: #fffbea;
  color: var(--ink);
  text-shadow: none;
  box-shadow: 0 2px 0 rgba(90, 70, 50, 0.18);
}
#board, #wishes, #popup-card {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 72px;
  width: min(430px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 249, 230, 0.97);
}
#board > header, #wishes > header, #popup-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 6px 20px;
}
#board h2, #wishes h2, #popup-card h2 { margin: 0; font-size: 24px; font-weight: 400; }
#board-close, #wishes-close, #card-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 24px;
  cursor: pointer;
}
#board-close:hover, #wishes-close:hover, #card-close:hover { background: rgba(90, 70, 50, 0.08); }
#compose, #wish-compose { padding: 4px 20px 14px; border-bottom: 2px solid var(--line); }
#compose textarea, #wish-compose input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  outline: 0;
  background: #fff;
  resize: none;
  font: inherit;
  color: inherit;
  line-height: 1.4;
}
#compose textarea:focus, #wish-compose input:focus { border-color: var(--accent); }
.compose-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
#post-count, #wish-count { color: var(--ink-soft); font-size: 13px; }
#compose button, #wish-compose button, .comment-form button {
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
#posts, #wish-list { flex: 1; overflow-y: auto; padding: 4px 20px 16px; }
#posts .empty, #wish-list .empty { padding: 28px 0; color: var(--ink-soft); text-align: center; }
.post { padding: 14px 0 10px; border-bottom: 2px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post-head, .comment-head { display: flex; align-items: baseline; gap: 8px; }
.post-head .time, .comment-head .time { color: var(--ink-soft); font-size: 12px; }
.post .del {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
}
.post .del:hover, .post .del.armed { color: #e0453f; }
.post-text { margin: 6px 0 8px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.post-actions { display: flex; gap: 16px; }
.post-actions button {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}
.post-actions button:hover { color: var(--ink); }
.post-actions .like[aria-pressed="true"] { color: #e0453f; }
.comments { margin-top: 6px; padding-left: 14px; border-left: 3px solid var(--line); }
.comment { padding: 6px 0; }
.comment-text { margin: 2px 0 0; line-height: 1.4; word-break: break-word; }
.comment-form { display: flex; gap: 8px; margin: 6px 0 4px; }
.comment-form input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  outline: 0;
  background: #fff;
}
.comment-form input:focus { border-color: var(--accent); }
.comment-form button { padding: 8px 14px; }

#status {
  position: fixed;
  top: 64px;
  left: 16px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--cream);
  color: #e0453f;
}

@media (max-width: 720px) {
  #editor { top: auto; height: 58vh; padding: 18px 20px; gap: 12px; border-radius: 24px 24px 0 0; }
  #editor h1 { font-size: 24px; }
  .opt-row .thumb { width: 56px; height: 56px; }
  #chat { left: 0; bottom: 0; width: 100vw; height: 32vh; border-radius: 20px 20px 0 0; }
  #emotes { right: 8px; left: 8px; bottom: calc(32vh + 8px); justify-content: space-between; gap: 4px; }
  #emotes button { padding: 8px 10px; }
  #emotes kbd { display: none; }
  #online { top: 8px; right: 8px; padding: 8px 12px; }
  #board, #wishes, #popup-card { top: 8px; right: 8px; left: 8px; bottom: 8px; width: auto; }
  #edit-avatar { top: 8px; left: 8px; }
  #sound-btn { top: 8px; left: 116px; }
  #card-btn { top: 104px; left: 8px; }
}

/* 소원 트리 */
.label.wishtree .name {
  padding: 5px 12px;
  border-radius: 999px;
  background: #fff3c4;
  color: var(--ink);
  text-shadow: none;
  box-shadow: 0 2px 0 rgba(90, 70, 50, 0.18), 0 0 18px rgba(255, 214, 110, 0.55);
}
#wish-count.warn { color: #e0453f; }
.wish { margin: 0 -8px; padding: 12px 8px 10px; border-radius: 12px; }
.wish .post-text::before { content: '★ '; color: #f0b429; }
.wish.flash { animation: wish-flash 1.8s ease-out; }
@keyframes wish-flash {
  0%, 35% { background: rgba(255, 210, 90, 0.38); }
  100% { background: transparent; }
}
#wish-tip {
  position: fixed;
  z-index: 6;
  max-width: 260px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 249, 230, 0.97);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 3px 0 rgba(90, 70, 50, 0.18);
  transform: translate(-50%, calc(-100% - 16px));
  word-break: break-word;
}
#wish-tip b { display: block; margin-bottom: 2px; color: var(--ink-soft); font-size: 12px; font-weight: 400; }

/* 12월 팝업 */
#popup-bar {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  border-radius: 999px;
  background: rgba(255, 249, 230, 0.95);
  box-shadow: 0 2px 0 rgba(90, 70, 50, 0.18);
  transform: translateX(-50%);
  white-space: nowrap;
}
#popup-bar .pb-title { color: #c62f37; }
#popup-bar .pb-dday { padding: 2px 8px; border-radius: 999px; background: #2f6b4a; color: #fff; font-size: 13px; }
#stamp-btn {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
}
#card-body { flex: 1; overflow-y: auto; padding: 0 20px 18px; }
#card-body h3 { margin: 16px 0 8px; font-size: 17px; font-weight: 400; }
.card-period { margin: 0; color: var(--ink-soft); font-size: 14px; }
.card-hint { margin: 8px 0 0; color: var(--ink-soft); font-size: 13px; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stamp { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; }
.stamp.got { cursor: default; }
.stamp-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 2px dashed rgba(90, 70, 50, 0.35);
  border-radius: 50%;
  font-size: 13px;
}
.stamp.got .stamp-mark {
  border: 3px double #c62f37;
  color: #c62f37;
  background: rgba(198, 47, 55, 0.08);
  transform: rotate(-12deg);
}
.stamp-name { font-size: 12px; text-align: center; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-h { color: var(--ink-soft); font-size: 12px; }
.cal-d { padding: 6px 0; border-radius: 10px; font-size: 13px; }
.cal-d.xmas { color: #c62f37; }
.cal-d.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-d.got { background: #c62f37; color: #fff; }
.goods { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 2px solid var(--line); }
.goods-name { flex: 0 0 auto; }
.goods-need { flex: 1; color: var(--ink-soft); font-size: 13px; }
.goods.owned .goods-need { color: #2f6b4a; }
.goods button { padding: 6px 14px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
.goods button:disabled { background: #b9b1a6; cursor: default; }
.chip.locked { opacity: 0.55; }
.opt-note { margin: 6px 0 0; color: #c62f37; font-size: 13px; }
#stamp-toast {
  position: fixed;
  top: 26%;
  left: 50%;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 28px 16px;
  border-radius: 22px;
  background: rgba(255, 249, 230, 0.97);
  box-shadow: 0 4px 0 rgba(90, 70, 50, 0.2);
  transform: translate(-50%, -50%) scale(0.6);
  opacity: 0;
  pointer-events: none;
}
#stamp-toast.show { animation: stamp-in 2.2s ease forwards; }
#stamp-toast.toast-reward.show { animation-duration: 4.1s; pointer-events: auto; }
@keyframes stamp-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(0.94); }
  18% { transform: translate(-50%, -50%) scale(1); }
  82% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -54%) scale(1); }
}
.toast-mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 4px double #c62f37;
  border-radius: 50%;
  color: #c62f37;
  font-size: 20px;
  transform: rotate(-12deg);
}
.toast-reward .toast-mark { border-color: #e0a92e; color: #e0a92e; font-size: 34px; }
.toast-title { font-size: 20px; }
.toast-sub { color: var(--ink-soft); font-size: 13px; }
#stamp-toast button { margin-top: 6px; padding: 7px 16px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
.photo-label .name { background: #fff3c4 !important; }
#photo {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(20, 24, 46, 0.72);
}
#photo[hidden] { display: none; }
#photo-img { max-width: min(420px, 86vw); max-height: 70vh; border-radius: 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); transform: rotate(-1.5deg); }
.photo-actions { display: flex; gap: 8px; }
.photo-actions a, .photo-actions button {
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: #fff9e6;
  color: var(--ink);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.photo-actions a#photo-save { background: var(--accent); color: #fff; }
.photo-hint { margin: 0; color: #e9e6f5; font-size: 13px; }
body.flash::after { content: ''; position: fixed; inset: 0; z-index: 10; background: #fff; animation: flash 0.4s ease-out forwards; pointer-events: none; }
@keyframes flash { from { opacity: 0.9; } to { opacity: 0; } }
#board, #wishes, #popup-card { z-index: 6; }
@media (max-width: 700px) {
  #popup-bar { top: 58px; left: 8px; gap: 6px; padding: 4px 4px 4px 6px; font-size: 13px; transform: none; }
  #popup-bar .pb-title { display: none; }
}

/* 서브 퀘스트 · 굿즈 핀 */
.pins { display: flex; gap: 6px; margin-bottom: 6px; }
.pin { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #efe7d8; font-size: 18px; filter: grayscale(1); opacity: 0.45; }
.pin.got { background: #fff3c4; box-shadow: 0 0 0 2px #e0a92e inset; filter: none; opacity: 1; }
.quest { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.quest-badge { width: 22px; text-align: center; }
.quest-name { flex: 1; }
.quest-n { color: var(--ink-soft); font-size: 13px; }
.quest.done .quest-n { color: #2f6b4a; }
.quest.done .quest-name { text-decoration: line-through; color: var(--ink-soft); }
.quest button { padding: 4px 10px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: 12px; cursor: pointer; }
#profile-goods { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 8px; }
#profile-goods[hidden] { display: none; }
#profile-goods .pin { width: 28px; height: 28px; font-size: 15px; }
.ride-label .name { background: #ffe1e6 !important; }

/* 네컷 부스 */
#fourcut {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 7;
  width: min(420px, calc(100vw - 24px));
  padding: 14px 18px 18px;
  border-radius: 22px;
  background: rgba(255, 249, 230, 0.97);
  box-shadow: 0 4px 0 rgba(90, 70, 50, 0.2);
  transform: translateX(-50%);
}
#fourcut header { display: flex; align-items: center; justify-content: space-between; }
#fourcut h2 { margin: 0; font-size: 22px; font-weight: 400; }
#fourcut p { margin: 6px 0; font-size: 14px; }
#fourcut .fourcut-hint { color: var(--ink-soft); font-size: 12px; }
#fourcut-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; font-size: 22px; cursor: pointer; }
#preset-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.preset.on { border-color: var(--accent); }
.swatch-dot { width: 30px; height: 44px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
#fourcut-start { width: 100%; margin-top: 6px; padding: 10px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: 16px; cursor: pointer; }
#shoot-count {
  position: fixed;
  top: 40%;
  left: 50%;
  z-index: 8;
  color: #fff;
  font-size: 120px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
#shoot-count::after { content: attr(data-shot); position: absolute; top: -26px; left: 50%; font-size: 20px; white-space: nowrap; transform: translateX(-50%); }
#shoot-count.pop { animation: count-pop 0.7s ease-out; }
@keyframes count-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } 30% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

@media (max-width: 700px) {
  #emotes { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #emotes::-webkit-scrollbar { display: none; }
  #emotes button { flex: 0 0 auto; white-space: nowrap; }
}

/* 창작자 부스 */
.booth-label .name { background: #e8f3ff !important; }
#booth {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 7;
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 16px 20px 18px;
  border-radius: 22px;
  background: rgba(255, 249, 230, 0.98);
  box-shadow: 0 6px 0 rgba(90, 70, 50, 0.2);
  transform: translate(-50%, -50%);
}
#booth header { display: flex; align-items: flex-start; justify-content: space-between; }
#booth h2 { margin: 0; font-size: 26px; font-weight: 400; }
#booth-owner { color: var(--ink-soft); font-size: 14px; }
#booth-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; font-size: 24px; cursor: pointer; }
#booth-intro { margin: 10px 0; }
#booth-works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#booth-works .work { display: flex; flex-direction: column; gap: 4px; color: var(--ink); font-size: 12px; text-align: center; text-decoration: none; }
#booth-works img { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; background: #efe7d8; }
#booth-meta { margin: 10px 0 6px; color: #2f6b4a; font-size: 13px; }
.booth-actions { display: flex; gap: 8px; }
.booth-actions a { flex: 1; padding: 10px; border-radius: 999px; background: var(--accent); color: #fff; text-align: center; text-decoration: none; }
.booth-actions a + a { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.booth-actions a.off { opacity: 0.45; pointer-events: none; }
#booth-note { margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; }

/* 네컷: 포즈 세트, 함께 찍기 */
.fc-label { margin: 10px 0 4px !important; color: var(--ink-soft); font-size: 12px !important; }
#poseset-row { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow-y: auto; }
.poseset { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.poseset b { font-weight: 400; }
.poseset span { color: var(--ink-soft); font-size: 11px; }
.poseset.on { border-color: var(--accent); }
.fc-buttons { display: flex; gap: 8px; margin-top: 10px; }
.fc-buttons button { flex: 1; padding: 10px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: 15px; cursor: pointer; }
.fc-buttons button + button { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
#fourcut-group { background: #c62f37 !important; color: #fff !important; box-shadow: none !important; }
#wait-members { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wait-chip { padding: 4px 10px; border-radius: 999px; background: #fff3c4; font-size: 13px; }
#shoot-invite {
  position: fixed;
  top: 84px;
  left: 50%;
  z-index: 8;
  width: min(360px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 249, 230, 0.98);
  box-shadow: 0 4px 0 rgba(90, 70, 50, 0.2), 0 0 0 3px #e0a92e inset;
  transform: translateX(-50%);
}
#invite-text { font-size: 16px; }
#invite-sub { margin-top: 2px; color: var(--ink-soft); font-size: 12px; }
#shoot-count::after { white-space: nowrap; }

/* ---------- 크리에이터 카드 ---------- */
.label .field { margin-top: 1px; padding: 0 7px; border-radius: 999px; background: rgba(47, 107, 74, 0.86); color: #fff; font-size: 11px; line-height: 17px; white-space: nowrap; }
.label .field[hidden] { display: none; }
.ccard { --cc: #7a5a44; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 16px; background: #fffdf7; box-shadow: inset 5px 0 0 var(--cc), 0 2px 0 rgba(90, 70, 50, 0.12); text-align: left; }
.ccard-label { color: var(--ink-soft); font-size: 11px; }
.ccard-top { display: flex; align-items: center; gap: 10px; }
.ccard-img { width: 52px; height: 52px; border-radius: 14px; background: rgba(90, 70, 50, 0.07); }
.ccard-name { color: var(--cc); font-size: 18px; }
.ccard-fields { color: #2f6b4a; font-size: 13px; }
.ccard-intro { margin: 0; font-size: 15px; line-height: 1.45; }
.ccard-tools { color: var(--ink-soft); font-size: 12px; }
.ccard-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.ccard-acts a, .ccard-acts button { padding: 5px 12px; border: 2px solid var(--accent); border-radius: 999px; background: #fff; color: #0f9488; font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
.ccard-acts button:disabled { border-color: #cfd8d2; color: var(--ink-soft); cursor: default; }
#cards {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 7;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 16px 20px 18px;
  border-radius: 22px;
  background: rgba(255, 249, 230, 0.98);
  box-shadow: 0 6px 0 rgba(90, 70, 50, 0.2);
  transform: translate(-50%, -50%);
}
#cards[hidden] { display: none; }
#cards header { display: flex; align-items: center; justify-content: space-between; }
#cards h2 { margin: 0; font-size: 24px; font-weight: 400; }
#cards-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: none; font-size: 24px; cursor: pointer; }
#cards-tabs { display: flex; gap: 6px; margin: 10px 0 12px; }
#cards-tabs button { flex: 1; padding: 8px; border: 2px solid var(--accent); border-radius: 999px; background: #fff; color: #0f9488; font: inherit; cursor: pointer; }
#cards-tabs button.on { background: var(--accent); color: #fff; }
#cards .muted { color: var(--ink-soft); font-size: 14px; }
.card-form { display: flex; flex-direction: column; gap: 6px; }
.card-form label { margin-top: 4px; color: var(--ink-soft); font-size: 13px; }
.card-form input { padding: 9px 12px; border: 2px solid #e6dcc8; border-radius: 12px; background: #fff; font: inherit; font-size: 15px; }
.card-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.card-chips button { padding: 5px 12px; border: 2px solid #e6dcc8; border-radius: 999px; background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
.card-chips button.on { border-color: #2f6b4a; background: #2f6b4a; color: #fff; }
.card-preview-label { margin: 14px 0 6px; color: var(--ink-soft); font-size: 13px; }
.card-save { width: 100%; margin-top: 12px; padding: 11px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: 16px; cursor: pointer; }
.ccard-list { display: flex; flex-direction: column; gap: 10px; }
#profile-card { align-self: stretch; }
#profile-card[hidden] { display: none; }
#profile-swap { background: #2f6b4a !important; border-color: #2f6b4a !important; color: #fff !important; }
#profile-swap:disabled { background: #fff !important; border-color: #cfd8d2 !important; color: var(--ink-soft) !important; cursor: default; }
#card-ask {
  position: fixed;
  top: 84px;
  left: 50%;
  z-index: 8;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 249, 230, 0.98);
  box-shadow: 0 4px 0 rgba(90, 70, 50, 0.2), 0 0 0 3px #2f6b4a inset;
  transform: translateX(-50%);
}
#card-ask[hidden] { display: none; }
#card-ask-text { font-size: 16px; }
#card-ask-sub { color: var(--ink-soft); font-size: 12px; }
.card-ask-btns { display: flex; gap: 8px; }
.card-ask-btns button { flex: 1; padding: 9px; border: 2px solid #2f6b4a; border-radius: 999px; background: #fff; color: #2f6b4a; font: inherit; cursor: pointer; }
#card-ask-yes { background: #2f6b4a !important; color: #fff !important; }
.profile-row { display: flex; gap: 6px; }
.profile-row button { flex: 1; padding: 8px 4px !important; font-size: 13px; }
.profile-row button[hidden] { display: none; }

/* ---------- 스레드 임베드·부스 거리 ---------- */
iframe.th-embed { display: block; width: 100%; min-height: 140px; height: 160px; border: 0; border-radius: 12px; background: #fff; }
#booth-works { display: flex !important; flex-direction: column; gap: 10px; }
.booth-works-title { margin-top: 6px; color: var(--ink-soft); font-size: 13px; }
#booth-remove { margin-top: 10px; padding: 6px 12px; border: 0; background: none; color: #c62f37; font: inherit; font-size: 13px; cursor: pointer; }
#booth-remove.armed { background: #c62f37; color: #fff; border-radius: 999px; }
.cb-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cb-row { --cc: #7a5a44; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px; background: #fffdf7; box-shadow: inset 5px 0 0 var(--cc), 0 2px 0 rgba(90, 70, 50, 0.1); }
.cb-head { display: flex; align-items: center; gap: 10px; }
.cb-head .ccard-img { width: 40px; height: 40px; border-radius: 10px; }
.cb-head .ccard-name { font-size: 16px; }
.cb-embed[hidden] { display: none; }
.cards-search { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 2px solid #e6dcc8; border-radius: 12px; background: #fff; font: inherit; font-size: 15px; }
.card-go { width: 100%; margin-top: 10px; padding: 9px; border: 2px solid #2f6b4a; border-radius: 999px; background: #fff; color: #2f6b4a; font: inherit; cursor: pointer; }
#profile-card .card-go { margin-top: 6px; }

/* ---------- 광장 안내 마스코트 ---------- */
.label.mascot .name { color: #3da55a; }
#mascot {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 8;
  width: min(560px, calc(100vw - 24px));
  padding: 16px 20px 14px;
  border-radius: 22px;
  background: rgba(255, 249, 230, 0.98);
  box-shadow: 0 6px 0 rgba(90, 70, 50, 0.2), 0 0 0 3px #3da55a inset;
  transform: translateX(-50%);
}
#mascot[hidden] { display: none; }
#mascot-close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; font-size: 22px; cursor: pointer; }
.mascot-head { display: flex; align-items: center; gap: 12px; }
#mascot-img { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; background: #e8f4ec; }
#mascot-name { color: #2f6b4a; font-size: 20px; }
#mascot-role { color: var(--ink-soft); font-size: 13px; }
#mascot-text { min-height: 3.2em; margin: 10px 0; font-size: 17px; line-height: 1.55; cursor: pointer; }
#mascot-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#mascot-actions button { padding: 8px 16px; border: 0; border-radius: 999px; background: #2f6b4a; color: #fff; font: inherit; cursor: pointer; }
#mascot-actions button.soft { border: 2px solid #2f6b4a; background: #fff; color: #2f6b4a; }
#mascot-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed #d9ccb4; }
#mascot-topics button { padding: 4px 10px; border: 0; border-radius: 999px; background: none; color: var(--ink-soft); font: inherit; font-size: 13px; cursor: pointer; }
#mascot-topics button.on { background: #e8f4ec; color: #2f6b4a; }
@media (max-width: 700px) { #mascot { bottom: auto; top: 70px; } #mascot-text { font-size: 15px; } }

/* ---------- 놀이마당 게임 창·건배·카운트다운 ---------- */
#game { position: fixed; top: 70px; left: 16px; z-index: 6; width: min(380px, calc(100vw - 24px)); max-height: calc(100vh - 400px); overflow-y: auto; padding: 12px 16px; border-radius: 18px; background: rgba(255, 249, 230, 0.97); box-shadow: 0 4px 0 rgba(90, 70, 50, 0.2), 0 0 0 3px #2f6b4a inset; }
#game[hidden] { display: none; }
#game-title { color: #2f6b4a; font-size: 19px; }
#game p { margin: 6px 0; }
#game .muted { color: var(--ink-soft); font-size: 13px; }
.game-q { font-size: 17px; }
.game-big { font-size: 22px; color: #c0392b; }
.game-btn { margin-top: 6px; padding: 7px 16px; border: 0; border-radius: 999px; background: #2f6b4a; color: #fff; font: inherit; cursor: pointer; }
.game-opts { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.game-opt { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 10px; }
.game-opt.ok { background: #e8f4ec; font-weight: 700; }
.pad-dot { width: 14px; height: 14px; border-radius: 50%; }
.pad0 .pad-dot { background: #e0453f; }
.pad1 .pad-dot { background: #e0a92e; }
.pad2 .pad-dot { background: #3f7fe0; }
.work-crop { height: 260px; overflow: hidden; border-radius: 12px; margin: 6px 0; background: #fff; }
.work-crop iframe.th-embed { margin-top: -72px; min-height: 340px; }
.snow-score { display: flex; justify-content: center; gap: 10px; font-size: 22px; }
.snow-score .team0 { color: #d8343c; }
.snow-score .team1 { color: #2f8a4f; }
.game-rank { margin: 4px 0 0 18px; padding: 0; }
.label.team0 .name { background: rgba(216, 52, 60, 0.9) !important; color: #fff !important; border-radius: 999px; padding: 0 6px; }
.label.team1 .name { background: rgba(47, 138, 79, 0.9) !important; color: #fff !important; border-radius: 999px; padding: 0 6px; }
#countdown { position: fixed; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
#countdown[hidden] { display: none; }
.cd-num { color: #fff; font-size: 160px; text-shadow: 0 6px 0 rgba(90, 40, 30, 0.45), 0 0 40px rgba(255, 200, 120, 0.8); }
.cd-year { color: #ffe08a; font-size: 140px; text-shadow: 0 6px 0 rgba(90, 40, 30, 0.45), 0 0 50px rgba(255, 200, 120, 0.9); }
.cd-msg { color: #fff; font-size: 40px; text-shadow: 0 3px 0 rgba(90, 40, 30, 0.5); }
@media (max-width: 700px) { #game { top: 150px; left: 50%; transform: translateX(-50%); max-height: 40vh; } .cd-num { font-size: 110px; } .cd-year { font-size: 96px; } .cd-msg { font-size: 26px; } }

/* ---------- 썰매 경주 ---------- */
#race { position: fixed; top: 70px; left: 16px; z-index: 6; width: min(360px, calc(100vw - 24px)); padding: 12px 16px; border-radius: 18px; background: rgba(255, 249, 230, 0.97); box-shadow: 0 4px 0 rgba(90, 70, 50, 0.2), 0 0 0 3px #3f7fe0 inset; }
#race[hidden] { display: none; }
.race-1 { color: #2d5fb0; font-size: 20px; }
.race-2 { margin-top: 4px; color: var(--ink-soft); font-size: 14px; }
.game-btn.soft { background: #fff; color: #2f6b4a; border: 2px solid #2f6b4a; }
#race-cd { position: fixed; top: 36%; left: 50%; z-index: 9; transform: translate(-50%, -50%); color: #fff; font-size: 140px; text-shadow: 0 6px 0 rgba(40, 60, 110, 0.5), 0 0 40px rgba(140, 190, 255, 0.9); pointer-events: none; }
#race-cd[hidden] { display: none; }
#race-pad { position: fixed; left: 0; right: 0; bottom: 18px; z-index: 7; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 18px; pointer-events: none; }
#race-pad[hidden] { display: none; }
#race-pad button { pointer-events: auto; width: 84px; height: 84px; border: 0; border-radius: 50%; background: rgba(255, 249, 230, 0.92); font-size: 30px; box-shadow: 0 4px 0 rgba(90, 70, 50, 0.25); touch-action: none; }
#race-pad #race-brake { width: 110px; height: 56px; border-radius: 999px; font: inherit; font-size: 16px; }
@media (max-width: 700px) { #race { top: 150px; left: 50%; transform: translateX(-50%); } }

/* 경주 계기판·바퀴 기록 */
.race-hud .rh-top { color: #2d5fb0; font-size: 20px; }
.race-hud .rh-label { margin-top: 6px; color: var(--ink-soft); font-size: 13px; }
.race-hud .rh-cur { color: #16233d; font-size: 44px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.race-hud .rh-sub { color: #2d5fb0; font-size: 16px; font-variant-numeric: tabular-nums; }
#race-flash { position: fixed; top: 24%; left: 50%; z-index: 9; transform: translateX(-50%); text-align: center; pointer-events: none; }
#race-flash[hidden] { display: none; }
#race-flash .rf-main { color: #fff; font-size: 64px; text-shadow: 0 5px 0 rgba(40, 60, 110, 0.55), 0 0 30px rgba(140, 190, 255, 0.9); font-variant-numeric: tabular-nums; }
#race-flash .rf-sub { color: #ffe08a; font-size: 26px; text-shadow: 0 3px 0 rgba(40, 60, 110, 0.6); }
@media (max-width: 700px) { .race-hud .rh-cur { font-size: 34px; } #race-flash .rf-main { font-size: 42px; } }

/* 안내 문구: 기기별 */
@media (pointer: coarse) { .pc-only { display: none; } }
@media (pointer: fine) { .touch-only { display: none; } }
/* 휴대폰 경주 중: 조작 버튼이 채팅·감정표현과 겹치지 않게 숨긴다 */
body.racing #chat, body.racing #emotes { display: none !important; }

/* UX 검수 반영 (2026-12-01) */
/* 광장 안내 이름표: 눈 위에서도 읽히게 크림색 알약 (소원 트리 이름표와 같은 모양) */
.label.mascot .name { padding: 5px 12px; border-radius: 999px; background: #fff3c4; color: #2f6b4a; text-shadow: none; }
@media (max-width: 720px) {
  /* 감정표현 8개가 한 줄에 안 들어가면 옆으로 밀어서 본다 (잘리지 않게) */
  #emotes { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #emotes::-webkit-scrollbar { display: none; }
  #emotes button { flex: 0 0 auto; min-height: 40px; }
  /* 아이폰 홈 표시줄과 겹치지 않게 */
  #chat { padding-bottom: env(safe-area-inset-bottom); }
  /* 접속자 목록이 화면을 반 가까이 덮지 않게 */
  #online { max-height: 28vh; }
}
@media (pointer: coarse) {
  /* 손가락으로 누르기 쉬운 크기 */
  #ch-btn { min-height: 36px; padding: 6px 14px; }
  #online-list button { min-height: 32px; }
}

/* 네컷 꾸미기 */
#photo-stage { position: relative; display: inline-block; line-height: 0; }
#photo-stickers { position: absolute; inset: 0; overflow: hidden; }
#photo.deco { flex-direction: row; align-items: center; gap: 22px; padding: 16px; }
#photo.deco #photo-img { transform: none; max-height: 86vh; max-width: 40vw; }
#photo.deco .photo-actions, #photo.deco .photo-hint { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); }
#photo.deco .photo-hint { display: none; }
#photo-deco { width: min(360px, 90vw); max-height: 80vh; overflow-y: auto; padding: 14px 16px; border-radius: 20px; background: var(--cream); }
#photo-deco .deco-h { margin: 6px 0 6px; font-size: 15px; }
#photo-deco .deco-h span { margin-left: 6px; color: var(--ink-soft); font-size: 12px; }
#photo-deco .deco-row { display: flex; flex-wrap: wrap; gap: 6px; }
#photo-deco .preset { font-size: 13px; }
.stk-pick { min-width: 44px; height: 44px; padding: 0 6px; border: 0; border-radius: 12px; background: #fff; font-size: 26px; line-height: 1; cursor: pointer; font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; }
.stk-pick.txt { font-family: Jua, sans-serif; font-size: 15px; }
.stk-pick img { width: 34px; height: 34px; object-fit: contain; }
.stk-pick:hover { background: #fff3c4; }
#deco-tools { display: flex; gap: 6px; margin-top: 10px; }
#deco-tools button { flex: 1; min-height: 40px; border: 0; border-radius: 999px; background: #2f6b4a; color: #fff; font: inherit; font-size: 14px; cursor: pointer; }
#deco-tools.off button { background: #cfc8b8; cursor: default; }
.deco-check { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; }
.stk { position: absolute; line-height: 1; white-space: nowrap; cursor: grab; touch-action: none; user-select: none; }
.stk.txt { font-family: Jua, sans-serif; }
.stk.sel { outline: 2px dashed #fff; outline-offset: 4px; border-radius: 6px; }
@media (max-width: 720px) {
  #photo.deco { flex-direction: column; justify-content: flex-start; gap: 10px; padding: 10px 8px 70px; overflow-y: auto; }
  #photo.deco #photo-img { max-height: 52vh; max-width: 92vw; }
  #photo-deco { max-height: none; width: 94vw; }
  #photo.deco .photo-actions { position: fixed; bottom: calc(10px + env(safe-area-inset-bottom)); }
}
.photo-actions a, .photo-actions button { white-space: nowrap; }
@media (max-width: 720px) {
  #photo.deco { padding-bottom: 12px; }
  #photo.deco .photo-actions { position: sticky; bottom: 0; left: auto; transform: none; width: 100%; justify-content: center; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: rgba(20, 24, 46, 0.92); }
  #photo.deco #photo-img { max-height: 58vh; }
}

/* 장소 이동 */
#tp-btn { position: fixed; top: 16px; left: 372px; }
#tp-menu { position: fixed; top: 64px; left: 16px; z-index: 8; width: min(340px, calc(100vw - 16px)); max-height: calc(100vh - 140px); overflow-y: auto; padding: 12px 16px 14px; border-radius: 20px; background: var(--cream); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
#tp-menu[hidden] { display: none; }
#tp-menu header { display: flex; align-items: center; justify-content: space-between; }
#tp-menu h2 { margin: 0; font-size: 18px; }
#tp-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #efe7d8; font-size: 20px; cursor: pointer; }
#tp-menu .tp-h { margin: 10px 0 6px; color: var(--ink-soft); font-size: 13px; }
#tp-menu .tp-row { display: flex; flex-wrap: wrap; gap: 6px; }
#tp-menu .tp-row button { min-height: 40px; padding: 6px 14px; border: 0; border-radius: 999px; background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
#tp-menu .tp-row button:hover { background: #fff3c4; }
@media (max-width: 720px) {
  #tp-btn { top: 104px; left: 136px; }
  #tp-menu { top: 150px; left: 8px; }
}
/* 장소 이동: 그림 버튼 */
#tp-menu { width: min(380px, calc(100vw - 16px)); }
#tp-menu .tp-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#tp-menu .tp-row button.tp-item { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 0; padding: 8px 4px 8px; border-radius: 16px; background: #fff; font-size: 13px; line-height: 1.2; }
#tp-menu .tp-item img { width: 72px; height: 64px; object-fit: contain; transition: transform 0.15s ease; }
#tp-menu .tp-item:hover img { transform: translateY(-3px) scale(1.06); }
#tp-menu .tp-item span { white-space: nowrap; }
@media (max-width: 720px) {
  #tp-menu .tp-item img { width: 60px; height: 54px; }
  #tp-menu { max-height: calc(100vh - 230px); }
}
@media (min-width: 721px) {
  #tp-menu { width: 470px; }
  #tp-menu .tp-row { grid-template-columns: repeat(4, 1fr); }
}

/* 눈덩이 게이지 (머리 위) */
#snow-gauge { position: fixed; left: 0; top: 0; z-index: 6; width: 104px; height: 14px; padding: 2px; border-radius: 999px; background: rgba(20, 24, 46, 0.6); pointer-events: none; }
#snow-gauge[hidden] { display: none; }
#snow-gauge i { display: block; width: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #bfe3ff, #ffffff); }
#snow-gauge.hot i { background: linear-gradient(90deg, #ffd36b, #ff7a59); }

/* 1:1 메시지 알림 */
#dm-toast { position: fixed; top: 74px; left: 50%; z-index: 9; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-width: min(420px, 90vw); padding: 12px 18px; border: 0; border-radius: 18px; background: #2f6b4a; color: #fff; font: inherit; text-align: left; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28); transform: translateX(-50%); cursor: pointer; }
#dm-toast[hidden] { display: none; }
#dm-toast b { font-size: 15px; }
#dm-toast span { font-size: 15px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
#dm-toast em { font-size: 12px; font-style: normal; opacity: 0.8; }
#dm-toast.pop { animation: dmpop 0.35s ease-out; }
@keyframes dmpop { from { transform: translate(-50%, -14px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.tab .unread { animation: unreadPulse 1.2s ease-in-out infinite; }
@keyframes unreadPulse { 50% { transform: scale(1.25); box-shadow: 0 0 0 4px rgba(224, 69, 63, 0.25); } }
@media (max-width: 720px) { #dm-toast { top: 150px; } }

/* 프로필 창: 캐릭터 대신 스레드 프로필 (공식 임베드) */
#profile-pic { align-self: stretch; border-radius: 14px; overflow: hidden; background: #fff; }
#profile-pic[hidden] { display: none; }
#profile-pic.head { height: 104px; }
#profile-pic.head iframe.th-embed { min-height: 420px; }

/* 배치 모드 (운영자) */
#layout-btn { position: fixed; top: 64px; left: 16px; padding: 9px 16px; border: 0; border-radius: 999px; background: var(--cream); font: inherit; cursor: pointer; }
#layout-btn.on { background: #ffd36b; }
#layout-panel { position: fixed; top: 112px; left: 16px; z-index: 8; display: flex; flex-direction: column; gap: 8px; width: 270px; padding: 12px 14px; border-radius: 18px; background: var(--cream); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
#layout-panel[hidden] { display: none; }
#layout-panel .lrow { display: flex; gap: 6px; }
#layout-panel button, #layout-panel select { flex: 1; min-width: 0; min-height: 36px; padding: 4px 10px; border: 0; border-radius: 999px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
#layout-panel button:hover:not(:disabled) { background: #fff3c4; }
#layout-panel button:disabled { opacity: 0.4; cursor: default; }
#layout-sel { color: var(--ink-soft); font-size: 13px; }
#layout-help { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
@media (max-width: 720px) {
  #layout-btn { top: 152px; }
  #layout-panel { top: 200px; }
}

/* 블라인드 갤러리 */
#blind { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 9; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 14px 16px 16px; border-radius: 22px; background: var(--cream); box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25); }
#blind[hidden] { display: none; }
#blind header { display: flex; align-items: center; justify-content: space-between; }
#blind h2 { margin: 0; font-size: 19px; }
#blind-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #efe7d8; font-size: 20px; cursor: pointer; }
#blind-body { display: flex; flex-direction: column; gap: 8px; }
.blind-info { margin: 0; color: var(--ink-soft); font-size: 13px; }
.blind-crop { position: relative; height: 420px; overflow: hidden; border-radius: 14px; background: #fff; }
.blind-crop iframe.th-embed { margin-top: -64px; min-height: 300px; }
.blind-row { display: flex; gap: 8px; }
.blind-row button { flex: 1; min-height: 44px; border: 0; border-radius: 999px; font: inherit; font-size: 15px; cursor: pointer; }
.blind-skip { background: #fff; }
.blind-skip:hover { background: #fff3c4; }
.blind-pick { min-height: 46px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: inherit; font-size: 15px; cursor: pointer; }
.blind-who { margin: 0; font-size: 18px; }
.blind-head { height: 104px; overflow: hidden; border-radius: 14px; background: #fff; }
.blind-head iframe.th-embed { min-height: 420px; }
.blind-here { margin: 0; padding: 8px 10px; border-radius: 12px; background: #fff3c4; font-size: 14px; }
.blind-text { min-height: 64px; padding: 10px; border: 2px solid #e7dccb; border-radius: 12px; font: inherit; font-size: 14px; resize: vertical; }
.blind-mine { padding: 8px 10px; border-radius: 12px; background: rgba(90, 70, 50, 0.07); color: var(--ink-soft); font-size: 12.5px; }
.card-blind { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.toast-play .toast-mark { background: #3f7fe0; }

/* ================= UI ver2 (2026-12-02) =================
   규칙: 화면 가장자리 16px, 패널 안쪽 20px, 요소 간격 12px. 본문 14px 이상, 보조 12px 이상.
   주 버튼 색 = 청록(--accent) 하나, 보조 = 흰 바탕, 운영자·위험 = 빨강. 모서리: 패널 20px, 버튼 알약, 카드 12px. */
:root { --ink-soft: #7d6a52; }
.v2-hide { display: none !important; }
#menu-btn { position: fixed; top: 16px; left: 16px; z-index: 7; padding: 9px 16px; border: 0; border-radius: 999px; background: var(--cream); font: inherit; cursor: pointer; box-shadow: 0 2px 0 rgba(90, 70, 50, 0.18); }
#menu-btn[aria-expanded="true"] { background: #fff; }
#menu-pop { position: fixed; top: 62px; left: 16px; z-index: 8; display: flex; flex-direction: column; gap: 6px; min-width: 190px; padding: 10px; border-radius: 20px; background: var(--cream); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
#menu-pop[hidden] { display: none; }
#menu-pop > button { position: static !important; display: block; width: 100%; padding: 10px 14px; border: 0; border-radius: 999px; background: #fff; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
#menu-pop > button[hidden] { display: none; }
#menu-pop > button:hover { background: #fff3c4; }
#menu-pop #layout-btn.on { background: #ffd36b; }
#layout-panel { top: 62px; left: 220px; }
/* 주 버튼 4개 */
#dock { position: fixed; left: 50%; bottom: 16px; z-index: 5; display: flex; gap: 8px; padding: 6px; border-radius: 999px; background: rgba(255, 249, 230, 0.96); box-shadow: 0 4px 16px rgba(60, 40, 20, 0.18); transform: translateX(-50%); }
#dock[hidden], #dock.racing { display: none; }
#dock button { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border: 0; border-radius: 999px; background: #fff; font: inherit; font-size: 15px; white-space: nowrap; cursor: pointer; }
#dock button:first-child { background: var(--accent); color: #fff; }
#dock button:hover { filter: brightness(0.97); }
#dock button.on { outline: 3px solid #ffd36b; }
#dock .dk-ico { font-size: 17px; line-height: 1; }
/* 반응: 이모트 접기 */
#react-btn { position: fixed; right: 16px; bottom: 16px; z-index: 5; min-height: 44px; padding: 8px 18px; border: 0; border-radius: 999px; background: var(--cream); font: inherit; font-size: 15px; cursor: pointer; box-shadow: 0 2px 0 rgba(90, 70, 50, 0.18); }
#emotes { bottom: 70px; max-width: 460px; flex-wrap: wrap; justify-content: flex-end; }
#emotes.folded { display: none; }
#emotes:not(.folded) { padding: 8px; border-radius: 20px; background: rgba(255, 249, 230, 0.96); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16); }
/* 채팅: 작게, 접기 */
#chat { height: min(230px, 32vh); }
#chat-fold { align-self: stretch; padding: 6px 14px; border: 0; border-bottom: 2px solid var(--line); background: rgba(255, 255, 255, 0.5); color: var(--ink-soft); font: inherit; font-size: 13px; text-align: right; cursor: pointer; }
#chat-fold.has-new { background: #ffe9a8; color: var(--ink); }
#chat.folded { height: auto; }
#chat.folded #log, #chat.folded #tabs { display: none; }
#chat.folded #chat-fold { border-bottom: 0; }
/* 부스·블라인드 */
.th-open { display: inline-block; align-self: flex-start; margin: 6px 0 10px; padding: 6px 12px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; text-decoration: none; box-shadow: inset 0 0 0 2px #e7dccb; }
.th-open:hover { background: #fff3c4; }
.blind-row { position: sticky; bottom: -16px; z-index: 1; margin: 0 -16px -16px; padding: 10px 16px 14px; background: var(--cream); box-shadow: 0 -8px 12px -8px rgba(60, 40, 20, 0.25); }
/* 휴대폰 */
@media (max-width: 720px) {
  #menu-btn { top: 8px; left: 8px; }
  #menu-pop { top: 54px; left: 8px; }
  #layout-panel { top: 54px; left: 8px; }
  #dock { left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); gap: 4px; padding: 4px; transform: none; justify-content: space-between; }
  #dock button { flex: 1; flex-direction: column; gap: 2px; min-height: 52px; padding: 6px 2px; font-size: 11.5px; white-space: normal; text-align: center; line-height: 1.15; }
  #dock .dk-ico { font-size: 18px; }
  #react-btn { right: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); min-height: 40px; padding: 6px 14px; font-size: 14px; }
  #emotes { left: 8px; right: 8px; bottom: calc(124px + env(safe-area-inset-bottom)); max-width: none; justify-content: center; }
  #chat { left: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); width: calc(100vw - 120px); height: 30vh; border-radius: 16px; }
  #chat.folded { height: auto; }
  #chat.folded #send { display: none; }
  #chat-fold { text-align: left; }
}
/* 데스크톱: 주 버튼은 채팅창 오른쪽에 (가운데 두면 채팅과 겹침) */
@media (min-width: 721px) {
  #dock { left: calc(16px + min(380px, 100vw - 32px) + 16px); transform: none; }
}
@media (min-width: 721px) and (max-width: 1199px) {
  #chat { width: 320px; }
  #dock { left: 352px; gap: 6px; }
  #dock button { padding: 8px 12px; font-size: 14px; }
}
#online-list .score { display: none; } /* UI ver2: 선물 개수(경쟁 표시) 숨김 */
/* UI ver2 검수 반영 (2026-12-02): 창이 아래 주 버튼을 덮지 않게, 주 버튼 색 통일 */
#dock button, #dock button:first-child { background: #fff; color: var(--ink); }
#dock button.on { background: #fff3c4; outline: 3px solid #ffd36b; }
#profile, #booth, #cards, #blind { top: calc(50% - 44px); max-height: calc(100vh - 120px); }
#board, #wishes, #popup-card { bottom: 88px; }
#tp-menu { max-height: calc(100vh - 160px); background: #fff9e6; }
@media (min-width: 721px) and (max-width: 1199px) {
  #popup-card { top: 112px; width: 360px; }
}
@media (max-width: 720px) {
  #profile, #booth, #cards, #blind { top: 8px; bottom: calc(80px + env(safe-area-inset-bottom)); max-height: none; transform: translateX(-50%); }
  #board, #wishes, #popup-card { bottom: calc(80px + env(safe-area-inset-bottom)); }
  #tp-menu { top: 54px; max-height: calc(100vh - 150px); }
  #dock button { font-size: 12px; letter-spacing: -0.02em; }
}

/* 실시간 수정 알림 */
#hot-bar { position: fixed; top: 64px; left: 50%; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; border-radius: 999px; background: #2f6b4a; color: #fff; font-size: 14px; transform: translateX(-50%); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }
#hot-bar button { padding: 6px 12px; border: 0; border-radius: 999px; background: #fff; color: #2f6b4a; font: inherit; cursor: pointer; }

/* 여는 시간: 닫힌 시간 화면 */
#closed { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(20, 24, 44, 0.55); backdrop-filter: blur(3px); }
#closed[hidden] { display: none; }
.closed-card { display: flex; flex-direction: column; gap: 10px; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px 20px; border-radius: 24px; background: var(--cream); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3); text-align: center; }
.closed-title { font-size: 24px; }
.closed-hours { margin: 0; font-size: 17px; }
.closed-host, .closed-note { margin: 0; color: var(--ink-soft); font-size: 14px; }
.closed-left { margin: 4px 0; padding: 10px; border-radius: 14px; background: #2f6b4a; color: #fff; font-size: 18px; }
.closed-main, .closed-sub { min-height: 46px; border: 0; border-radius: 999px; font: inherit; font-size: 15px; cursor: pointer; }
.closed-main { background: var(--accent); color: #fff; }
.closed-sub { background: #fff; }
.closed-list { display: flex; flex-direction: column; gap: 4px; text-align: left; font-size: 14px; }
.closed-list a { padding: 6px 10px; border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none; }

a.closed-main { display: grid; place-items: center; text-decoration: none; }

/* 호스트 애니모 (2026-12-02) */
#options .host-toggle { width: 100%; min-height: 46px; margin: 4px 0 10px; border: 2px dashed #2f8f5c; border-radius: 999px; background: #fff; color: #2f6b4a; font: inherit; font-size: 16px; cursor: pointer; }
#options .host-toggle.on { border-style: solid; background: #2f8f5c; color: #fff; }
#options .host-note { margin: 0 4px 8px; color: #5a4632; font-size: 14px; line-height: 1.5; }
.label.host .name { background: #2f8f5c; color: #fff; }

.acc-credit { margin: 10px 2px 0; font-size: 11px; line-height: 1.45; opacity: .62; }
.acc-credit a { color: inherit; }
