: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: 45dvh;
  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: 14px; }
#ch-btn { padding: 3px 10px; border: 0; border-radius: 999px; background: #2f6b4a; color: #fff; font: inherit; font-size: 14px; 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: 13px; }
#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: 14px; }
#ch-menu .ch-new, #ch-menu .ch-copy { justify-content: center; color: #2f6b4a; font-size: 14px; }
#booth-meet { margin: 0 0 8px; padding: 6px 14px; border: 0; border-radius: 999px; background: #2f6b4a; color: #fff; font: inherit; font-size: 14px; 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: 13px; margin-left: 6px; }
#log .sys { color: var(--ink-soft); font-size: 14px; }
#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: 14px; }
#gate .err { color: #e0453f; font-size: 14px; }
#gate .ok { color: #0b6b63; }
#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: #0b6b63;
  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(100dvh - 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: 14px; }
.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: #0b6b63;
  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: 14px; }
.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: #0b6b63; }
#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: #0b6b63; 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: 14px; }
#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: 13px; }
.post .del {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 14px;
  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: 13px; 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: 14px; }
#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: 14px; }
.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: 14px;
}
.stamp.got .stamp-mark {
  border: 3px double #c62f37;
  color: #c62f37;
  background: rgba(198, 47, 55, 0.08);
  transform: rotate(-12deg);
}
.stamp-name { font-size: 13px; 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: 13px; }
.cal-d { padding: 6px 0; border-radius: 10px; font-size: 14px; }
.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: 14px; }
.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: 14px; }
#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: 14px; }
#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: 70dvh; 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: 14px; }
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: 14px; 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: 14px; }
.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: 13px; 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: 13px; }
#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: 13px; 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(100dvh - 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: 13px; 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: 14px; }
.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: 13px; }

/* 네컷: 포즈 세트, 함께 찍기 */
.fc-label { margin: 10px 0 4px !important; color: var(--ink-soft); font-size: 13px !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: 14px; text-align: left; cursor: pointer; }
.poseset b { font-weight: 400; }
.poseset span { color: var(--ink-soft); font-size: 12px; }
.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: 14px; }
#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: 13px; }
#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: 12px; 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: 12px; }
.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: 14px; }
.ccard-intro { margin: 0; font-size: 15px; line-height: 1.45; }
.ccard-tools { color: var(--ink-soft); font-size: 13px; }
.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: #0b6b63; font: inherit; font-size: 14px; 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(100dvh - 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: #0b6b63; 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: 14px; }
.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: 14px; }
.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: 13px; }
.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: 14px; }
.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: 14px; }
#booth-remove { margin-top: 10px; padding: 6px 12px; border: 0; background: none; color: #c62f37; font: inherit; font-size: 14px; 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: 14px; }
#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: 14px; 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(100dvh - 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: 14px; }
.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: 40dvh; } .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: 14px; }
.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: 28dvh; }
}
@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: 86dvh; 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: 80dvh; 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: 13px; }
#photo-deco .deco-row { display: flex; flex-wrap: wrap; gap: 6px; }
#photo-deco .preset { font-size: 14px; }
.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: 52dvh; 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: 58dvh; }
}

/* 장소 이동 */
#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(100dvh - 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: 14px; }
#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: 14px; 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(100dvh - 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: 13px; 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: 14px; 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: 14px; }
#layout-help { color: var(--ink-soft); font-size: 13px; 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(100dvh - 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: 14px; }
.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: 14px; 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: 14px; 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: 14px; 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: 13px; white-space: nowrap; text-align: center; line-height: 1.15; }
  #dock .dk-long { display: none; }
  /* 휴대폰: 접속자 이름 목록은 접어 두고 "n명"을 누르면 펼친다 (위 띠와 겹침 방지) */
  #online:not(.open) #online-list { display: none; }
  #online:not(.open) #online-head { margin-bottom: 0; }
  #online-count { cursor: pointer; }
  #online-count::after { content: ' ▾'; }
  #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(100dvh - 120px); }
#board, #wishes, #popup-card { bottom: 88px; }
#tp-menu { max-height: calc(100dvh - 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(100dvh - 150px); }
  #dock button { font-size: 13px; 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 { white-space: nowrap; }
#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(100dvh - 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: 12px; line-height: 1.45; opacity: .62; }
.acc-credit a { color: inherit; }

/* ---------- 검수 11 반영 (2026-12-03) ---------- */
/* B7 주 버튼 대비: 흰 글씨 4.9:1 */
:root { --accent: #0f7f76; --accent-text: #0b6b63; --body-font: "Jua", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; --title-font: "Jua", system-ui, "Malgun Gothic", sans-serif; }
/* B8 본문은 읽는 글꼴, 제목·버튼·이름표는 Jua */
html, body { font-family: var(--body-font); line-height: 1.5; }
h1, h2, h3, button, button *, summary, .label, #labels, #labels *, .ccard-name, .pb-title, .pb-dday, .blind-who, #tips b, .field input, #near-act { font-family: var(--title-font) !important; }
.badge-v { color: var(--accent-text); }
/* A2 아바타 만들기: 한 줄 소개, 입장 버튼 고정, 꾸미기 접기 */
.editor-intro { margin: -8px 0 0; color: var(--ink-soft); font-size: 15px; }
#editor { padding-bottom: 0; }
#editor .actions { position: sticky; bottom: 0; z-index: 2; margin: auto -32px 0; padding: 12px 32px 20px; background: #fff9e6; box-shadow: 0 -8px 14px -10px rgba(60, 40, 20, 0.35); }
#options:not(.more) .opt-more { display: none; }
.opt-more-btn { align-self: flex-start; padding: 8px 16px; border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font-size: 15px; cursor: pointer; }
@media (max-width: 720px) { #editor .actions { margin: auto -20px 0; padding: 10px 20px calc(14px + env(safe-area-inset-bottom)); } .editor-intro { font-size: 14px; } }
/* A3 첫 안내 */
#tips .tips-sub { margin: -4px 0 10px; color: var(--ink-soft); }
#tips .tips-move { margin: 0 0 14px; padding: 8px 12px; border-radius: 12px; background: rgba(90, 70, 50, 0.07); font-size: 14px; }
#tips b { min-width: 72px; color: var(--accent-text); }
/* A4 부스·포토 부스 근처 버튼 */
body.editing #near-act { display: none !important; }
#near-act { position: fixed; left: 50%; bottom: 84px; z-index: 6; min-height: 48px; padding: 10px 24px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 17px; transform: translateX(-50%); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22); cursor: pointer; }
@media (max-width: 720px) { #near-act { bottom: calc(130px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } }
/* A1 내 카드 */
.card-howto { margin: 6px 0 2px; padding: 8px 12px; border-radius: 12px; background: #eaf6f3; color: var(--ink); font-size: 14px; }
.card-form input:disabled { opacity: 0.5; }
.muted.small { font-size: 14px; }
/* B2 위 띠: 모임 시간, 스탬프는 보조 버튼 */
#stamp-btn { background: #fff !important; color: var(--ink) !important; box-shadow: inset 0 0 0 2px var(--line); }
.together { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.together button { padding: 8px 14px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; }
.cal-box { margin: 10px 0; }
.cal-box summary { cursor: pointer; font-size: 16px; padding: 4px 0; }
/* B1 작가 공개 팔로우 */
.blind-follow { align-self: stretch; text-align: center; font-size: 15px; }
/* B6 포토 부스 */
#fourcut-group { background: var(--accent) !important; color: #fff !important; box-shadow: none !important; }
#fourcut-solo { background: #fff !important; color: var(--ink) !important; box-shadow: inset 0 0 0 2px var(--line) !important; }
.fc-buttons #fourcut-group { order: -1; }
.poseset b { flex: 1 0 auto; min-width: 7.5em; white-space: nowrap; }
.poseset span { font-size: 14px; text-align: right; }
body:has(#photo:not([hidden])) #dock, body:has(#photo:not([hidden])) #react-btn, body:has(#photo:not([hidden])) #emotes, body:has(#photo:not([hidden])) #near-act { display: none !important; }
/* B13 연결을 뺏긴 창 */
#kicked-cover { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(40, 30, 20, 0.6); color: #fff; text-align: center; padding: 20px; }
#kicked-cover button { padding: 12px 24px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 17px; cursor: pointer; }
/* B9 휴대폰: 창 뒤가 비치지 않게, 스탬프 카드 제목이 메뉴 버튼 아래로 */
@media (max-width: 720px) {
  #blind, #cards, #booth, #profile, #popup-card, #board, #wishes { background: #fff9e6; }
  #profile, #booth, #cards, #blind { top: 56px; }
  #popup-card, #board, #wishes { top: 56px; max-height: none; }
  #dock button { font-size: 13px; letter-spacing: -0.04em; word-break: keep-all; }
}

/* 네컷 부스: 배경 고르기, 사진 색감 */
.fc-label span { margin-left: 6px; color: var(--ink-soft); font-size: 13px; }
#bd-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
#bd-row .bd { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
#bd-row .bd img { width: 100%; aspect-ratio: 2.17; object-fit: cover; border-radius: 8px; display: block; }
#bd-row .bd.on { border-color: var(--accent); }
@media (max-width: 480px) { #bd-row { grid-template-columns: repeat(2, 1fr); } }
#deco-tones { display: flex; flex-wrap: wrap; gap: 6px; }
.tone-pick { min-height: 36px; padding: 6px 14px; border: 2px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.tone-pick.on { border-color: var(--accent); color: var(--accent); }

/* 주민카드형 크리에이터 카드 (C-PLZ-014) */
.mc-preview { display: flex; justify-content: center; margin: 4px 0 8px; }
.mc-preview canvas, .pf-cardimg canvas, .cb-face canvas { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: 0 4px 14px rgba(43, 29, 18, 0.18); }
.mc-preview canvas { max-width: 240px; }
.mc-colors { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.mc-colors button { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(43, 29, 18, 0.25); cursor: pointer; padding: 0; }
.mc-colors button.on { outline: 3px solid #0f7f76; outline-offset: 2px; }
.pf-cardimg { max-width: 220px; margin: 0 auto 8px; }
.cb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 8px; }
.cb-cell { display: flex; flex-direction: column; gap: 6px; }
.cb-face { cursor: pointer; }
.cb-cell .ccard-acts { flex-wrap: wrap; gap: 4px; }
.cb-cell .ccard-acts a, .cb-cell .ccard-acts button { font-size: 13px; }

/* 내 프사 올리기 (내 카드 탭) */
.mc-photo { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 14px; background: rgba(15, 127, 118, 0.07); }
.mc-photo label { margin-top: 0; }
.mc-photo p { margin: 0; }
.mc-agree { display: flex; align-items: flex-start; gap: 8px; color: var(--ink); font-size: 14px; line-height: 1.45; cursor: pointer; }
.mc-agree input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: #0f7f76; }
.mc-photo-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.mc-photo-btns button { min-height: 40px; padding: 8px 14px; border: 1px solid rgba(43, 29, 18, 0.18); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; cursor: pointer; }
.mc-photo-btns button.primary { border-color: #0f7f76; background: #0f7f76; color: #fff; }
.mc-photo-btns button:disabled { opacity: 0.45; cursor: default; }
/* 호스트: 프사 승인 */
#cardimg-chip { position: fixed; top: 64px; left: 16px; z-index: 6; padding: 8px 14px; border: 0; border-radius: 999px; background: #ffd36b; color: #2b1d12; font: inherit; font-size: 14px; cursor: pointer; box-shadow: 0 2px 8px rgba(43, 29, 18, 0.18); }
#cardimg-chip[hidden], #cardimg-panel[hidden] { display: none; }
#cardimg-panel { position: fixed; top: 50%; left: 50%; z-index: 30; width: min(560px, calc(100vw - 24px)); max-height: min(82vh, 760px); display: flex; flex-direction: column; transform: translate(-50%, -50%); border-radius: 20px; background: var(--cream); box-shadow: 0 10px 40px rgba(43, 29, 18, 0.3); overflow: hidden; }
#cardimg-panel .ci-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; }
#cardimg-panel h2 { margin: 0; font-size: 20px; }
#cardimg-panel h3 { margin: 14px 0 6px; font-size: 16px; }
#cardimg-panel .ci-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; cursor: pointer; }
#cardimg-panel .ci-body { padding: 0 18px 18px; overflow-y: auto; }
#cardimg-panel .ci-row { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid rgba(43, 29, 18, 0.1); }
#cardimg-panel .ci-row img { width: 128px; height: 128px; flex: none; border-radius: 12px; object-fit: cover; background: #fff; }
#cardimg-panel .ci-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#cardimg-panel .ci-info a { color: #0b6b63; font-weight: 600; }
#cardimg-panel .ci-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
#cardimg-panel .ci-acts button, #cardimg-panel .ci-acts select, #cardimg-panel .ci-okcell button { min-height: 38px; padding: 6px 12px; border: 1px solid rgba(43, 29, 18, 0.18); border-radius: 999px; background: #fff; font: inherit; font-size: 14px; cursor: pointer; }
#cardimg-panel .ci-acts button.primary { border-color: #0f7f76; background: #0f7f76; color: #fff; }
#cardimg-panel .ci-ok { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
#cardimg-panel .ci-okcell { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; }
#cardimg-panel .ci-okcell img { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; }
@media (max-width: 720px) {
  #cardimg-chip { top: 104px; left: 8px; }
  #cardimg-panel .ci-row img { width: 96px; height: 96px; }
}

/* ---------- 스크롤바 (2026-12-03) ----------
   1) 스크롤바가 생기거나 사라져도 내용 여백이 밀리지 않게 양쪽에 자리를 미리 잡는다.
   2) 스크롤바는 광장 UI(크림 창, 갈색 글씨)에 맞춘 얇은 둥근 막대로 그린다. */
.closed-card, #blind, #blind-body, #booth, #card-body, #cardimg-panel .ci-body, #cards, #cards-body,
#editor, #game, #game-body, #log, #online, #photo-deco, #poseset-row, #posts, #wish-list, #profile,
#tp-menu, #tp-list, #layout-panel, #menu-pop, #mascot, #gate form {
  scrollbar-gutter: stable both-edges;
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(90, 70, 50, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: rgba(90, 70, 50, 0.45); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
/* ::-webkit-scrollbar를 모르는 브라우저(파이어폭스)용 */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: rgba(90, 70, 50, 0.35) transparent; }
}

/* 분야 묶음·카드 그림 고르기 (2026-12-03) */
.card-chips-wrap { display: grid; gap: 6px; }
.card-chips-group { margin-top: 4px; color: var(--ink-soft); font-size: 13px; }
.card-chips button:disabled { opacity: 0.45; cursor: default; }
.card-chips button.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.mc-pic { display: flex; gap: 0; margin: 4px 0 8px; border: 2px solid var(--accent); border-radius: 999px; overflow: hidden; width: fit-content; }
.mc-pic button { min-height: 40px; padding: 8px 18px; border: 0; background: #fff; color: var(--accent-text); font: inherit; cursor: pointer; }
.mc-pic button.on { background: var(--accent); color: #fff; }
.mc-pic button:disabled { color: #b5a891; cursor: default; }
.mc-sub { margin-top: 6px; }

/* 굿즈 가게 진열 창 (2026-12-03) */
#goods-shop { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20; width: min(720px, calc(100vw - 24px)); max-height: min(86vh, 820px); display: flex; flex-direction: column; background: #fff9e6; border-radius: 24px; box-shadow: 0 18px 48px rgba(43, 29, 18, 0.25); color: var(--ink); }
#goods-shop[hidden] { display: none; }
#goods-shop header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 6px; }
#goods-shop h2 { margin: 0; font-size: 22px; }
#goods-shop h3 { margin: 18px 0 8px; font-size: 17px; }
#goods-shop .gs-close { width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; font-size: 24px; color: var(--ink); cursor: pointer; }
#goods-shop .gs-body { padding: 0 22px 22px; overflow-y: auto; scrollbar-gutter: stable both-edges; }
.gs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.gs-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px 14px; border-radius: 18px; background: #fff; text-align: center; }
.gs-item:not(.owned) .gs-view { filter: saturate(0.55) brightness(1.04); }
.gs-view { width: 100%; max-width: 160px; aspect-ratio: 1; background: radial-gradient(circle at 50% 50%, #eadcc1 0 58%, transparent 59%); border-radius: 50%; }
.gs-name { font-family: var(--title-font); font-size: 17px; }
.gs-need { color: var(--ink-soft); font-size: 14px; line-height: 1.4; }
.gs-item.owned .gs-need { color: var(--accent-text); }
.gs-item button { min-height: 38px; padding: 6px 16px; border: 1px solid rgba(43, 29, 18, 0.18); border-radius: 999px; background: #fff; color: var(--ink); font-family: var(--title-font); cursor: pointer; }
.gs-item button.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.gs-pins { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gs-pin { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 8px 10px; border-radius: 14px; background: #fff; }
.gs-pin .gs-badge { grid-row: span 2; font-size: 24px; text-align: center; filter: grayscale(1); opacity: 0.55; }
.gs-pin.owned .gs-badge { filter: none; opacity: 1; }
.gs-pin-name { font-size: 14px; font-weight: 600; }
.gs-pin .gs-need { font-size: 12.5px; }
@media (max-width: 720px) {
  #goods-shop { top: auto; bottom: 0; transform: translateX(-50%); width: 100vw; max-height: 82dvh; border-radius: 22px 22px 0 0; }
  .gs-grid { grid-template-columns: repeat(2, 1fr); }
  .gs-pins { grid-template-columns: 1fr; }
}

/* 운영자: 부스 미리 짓기 창 (C-PLZ-015) */
#prebooth-btn[hidden], #prebooth-panel[hidden] { display: none; }
#prebooth-panel { position: fixed; top: 50%; left: 50%; z-index: 30; width: min(480px, calc(100vw - 24px)); max-height: min(82vh, 640px); display: flex; flex-direction: column; transform: translate(-50%, -50%); border-radius: 20px; background: var(--cream); box-shadow: 0 10px 40px rgba(43, 29, 18, 0.3); overflow: hidden; }
#prebooth-panel .ci-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; }
#prebooth-panel h2 { margin: 0; font-size: 20px; }
#prebooth-panel .ci-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; cursor: pointer; }
#prebooth-panel .ci-body { display: flex; flex-direction: column; gap: 10px; padding: 0 18px 18px; overflow-y: auto; }
#prebooth-panel textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid rgba(43, 29, 18, 0.18); border-radius: 12px; background: #fff; font: inherit; font-size: 15px; resize: vertical; }
#prebooth-panel .pb-go { align-self: flex-start; min-height: 42px; padding: 8px 20px; border: 0; border-radius: 999px; background: #0f7f76; color: #fff; font-family: var(--title-font, Jua); font-size: 16px; cursor: pointer; }
#booth .booth-empty { margin: 8px 0 0; font-size: 14px; }

/* ---------- 카드 입력 항목 (2026-12-03) ---------- */
.mc-item { margin: 14px 0 4px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.6); border: 1px solid var(--line); }
.mc-q { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 8px; }
.mc-q span { font-family: var(--title-font, Jua), sans-serif; font-size: 16px; color: var(--ink); }
.mc-q small { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.mc-line { display: flex; align-items: center; gap: 8px; }
.mc-line input { flex: 1; min-width: 0; }
.mc-count { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.mc-ex { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.mc-tools { margin: 6px 0 8px; }
.mc-tools button:disabled { opacity: 0.55; }
.mc-item > div > input[type="text"] { width: 100%; box-sizing: border-box; }
.mc-flip { display: flex; gap: 6px; justify-content: center; margin: 6px 0; }
.mc-flip button { min-height: 32px; padding: 4px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.mc-flip button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.card-facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.65); font-size: 14px; }
.card-facts dt { color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.card-facts dd { margin: 0; color: var(--ink); word-break: keep-all; }
.cb-intro { font-size: 13px; color: var(--ink); opacity: 0.85; margin-top: 2px; }
@media (max-width: 720px) {
  .card-facts { grid-template-columns: 1fr; gap: 0 0; }
  .card-facts dd { margin-bottom: 6px; }
}

/* "새 화면이 있어요" 알림: 위 가운데는 열린 창(카드 색 줄 등)을 가려서 오른쪽 아래 [반응] 위로 옮긴다 (2026-12-03) */
#hot-bar { top: auto; left: auto; right: 16px; bottom: 76px; transform: none; z-index: 30; box-shadow: 0 4px 14px rgba(40, 30, 20, 0.18); }
@media (max-width: 720px) {
  #hot-bar { right: 8px; bottom: auto; top: calc(104px + env(safe-area-inset-top)); }
}

/* ---------- 입력칸 공통 디자인 (2026-12-03) ----------
   크림 바탕 + 따뜻한 갈색 테두리 + 높이 44px. 누르면 진한 청록 테두리와 옅은 빛.
   한 줄 칸은 둥근 알약(pz-field), 여러 줄은 12px 모서리. 채팅 입력은 제외(자체 배치). */
:root {
  --field-bg: #fffaf0;
  --field-line: rgba(90, 70, 50, 0.25);
  --field-ph: #9a8468;
  --field-ink: #3b2c1c;
  --field-focus: #0f7f76;
}
:where(#cards, #board, #wishes, #blind, #prebooth-panel, #gate, #booth, #cardimg-panel, #topic-panel) :is(input[type='text'], input[type='search'], input[type='url'], input:not([type]), textarea):not(.pz-bare):not(#chat *) {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--field-line);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--field-ink);
  font-family: var(--body-font);
  font-size: 15px;
  line-height: 1.4;
  outline: none;
  box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
:where(#cards, #board, #wishes, #blind, #prebooth-panel, #gate, #booth, #cardimg-panel, #topic-panel) textarea:not(.pz-bare) {
  padding: 10px 14px;
  resize: vertical;
}
:where(#cards, #board, #wishes, #blind, #prebooth-panel, #gate, #booth, #cardimg-panel, #topic-panel) input[type='search']:not(.pz-bare) {
  border-radius: 999px;
  padding: 0 18px;
}
:where(#cards, #board, #wishes, #blind, #prebooth-panel, #gate, #booth, #cardimg-panel, #topic-panel) :is(input, textarea)::placeholder { color: var(--field-ph); opacity: 1; }
:where(#cards, #board, #wishes, #blind, #prebooth-panel, #gate, #booth, #cardimg-panel, #topic-panel) :is(input[type='text'], input[type='search'], input[type='url'], input:not([type]), textarea):not(.pz-bare):not(#chat *):focus {
  border-color: var(--field-focus);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 127, 118, 0.18);
}

/* 앞에 @ 같은 글자가 붙는 한 줄 칸 */
.pz-field {
  display: flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  height: 46px;
  padding: 0 5px 0 16px;
  border: 1.5px solid var(--field-line);
  border-radius: 999px;
  background: var(--field-bg);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.pz-field:focus-within { border-color: var(--field-focus); background: #fff; box-shadow: 0 0 0 3px rgba(15, 127, 118, 0.18); }
.pz-prefix { color: var(--field-focus); font-family: var(--title-font, Jua); font-size: 18px; line-height: 1; }
.pz-bare { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--field-ink); font-family: var(--body-font); font-size: 15px; outline: none; }
.pz-bare::placeholder { color: var(--field-ph); }
.pz-add { flex: none; height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--field-focus); color: #fff; font-family: var(--title-font, Jua); font-size: 14px; cursor: pointer; }
.pz-add:hover { filter: brightness(1.06); }
.pz-hint { margin: 0 4px; color: var(--ink-soft, #7d6a52); font-size: 13px; }
.pz-hint.bad { color: #b3412f; }
.pz-slot { margin: 0; padding: 8px 12px; border-radius: 12px; background: rgba(15, 127, 118, 0.1); color: #0b6b63; font-size: 14px; }
.pz-slot[hidden], .pz-chips[hidden] { display: none; }
.pz-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pz-chip { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 0 4px 0 12px; border-radius: 999px; background: #e4f2ef; color: #0b6b63; font-size: 14px; font-weight: 600; }
.pz-chip-x { width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; color: #0b6b63; font-size: 17px; line-height: 1; cursor: pointer; }
.pz-chip-x:hover { background: rgba(15, 127, 118, 0.14); }
#prebooth-panel { width: min(420px, calc(100vw - 24px)); }
#prebooth-panel .pb-go:disabled { opacity: 0.45; cursor: default; }

/* "+" 빈 자리에서 연 내 카드: 맨 위 안내 */
.plot-pick { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(15, 127, 118, 0.1); color: #0b6b63; }
.plot-pick b { font-family: var(--title-font, Jua); font-weight: 400; font-size: 16px; }
.plot-pick span { font-size: 13px; }

/* 처음 한 번 부스 짓기 안내 */
#booth-guide { position: fixed; left: 50%; bottom: 96px; z-index: 31; width: min(380px, calc(100vw - 24px)); box-sizing: border-box; padding: 16px 18px 14px; border-radius: 20px; background: var(--cream, #fff9e6); box-shadow: 0 10px 30px rgba(40, 30, 20, 0.22); transform: translateX(-50%); }
#booth-guide h3 { margin: 0 0 6px; font-family: var(--title-font, Jua); font-weight: 400; font-size: 18px; color: var(--ink, #5a4632); }
#booth-guide p { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--ink, #5a4632); }
#booth-guide .bg-row { display: flex; gap: 8px; justify-content: flex-end; }
#booth-guide button { min-height: 40px; padding: 0 16px; border-radius: 999px; font-family: var(--title-font, Jua); font-size: 15px; cursor: pointer; }
#booth-guide .bg-later { border: 1.5px solid var(--field-line); background: transparent; color: var(--ink, #5a4632); }
#booth-guide .bg-go { border: 0; background: var(--field-focus); color: #fff; }
@media (max-width: 720px) {
  #booth-guide { bottom: calc(84px + env(safe-area-inset-bottom)); }
}


/* ---------- 포춘쿠키 창 (2026-12-03, 검수 30) ---------- */
#fortune { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20; width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 820px); display: flex; flex-direction: column; background: #fff9ec; border-radius: 24px; box-shadow: 0 18px 48px rgba(40, 28, 16, 0.28); color: var(--ink); }
#fortune[hidden] { display: none; }
#fortune header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 6px; }
#fortune h2 { margin: 0; font-family: var(--title-font); font-size: 22px; }
#fortune h3 { margin: 20px 0 8px; font-family: var(--title-font); font-size: 17px; }
#fortune .fc-close { width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; font-size: 24px; color: var(--ink); cursor: pointer; }
#fortune .fc-body { padding: 0 22px 22px; overflow-y: auto; scrollbar-gutter: stable both-edges; }
.fc-cookie-area { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 4px; text-align: center; }
.fc-lead { margin: 4px 0 0; font-family: var(--title-font); font-size: 18px; }
.fc-sub { margin: 4px 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.fc-cookie { position: relative; width: 170px; height: 120px; border: 0; background: none; cursor: pointer; }
.fc-cookie .half { position: absolute; top: 20px; width: 88px; height: 80px; background: radial-gradient(circle at 40% 35%, #f6c978, #d9963f 70%, #b97728); box-shadow: inset -6px -8px 0 rgba(120, 70, 20, 0.18); transition: transform 0.55s cubic-bezier(.3, 1.6, .5, 1); }
.fc-cookie .half.l { left: 6px; border-radius: 80px 10px 10px 80px / 70px 30px 30px 70px; }
.fc-cookie .half.r { right: 6px; border-radius: 10px 80px 80px 10px / 30px 70px 70px 30px; }
.fc-cookie .paper { position: absolute; left: 50%; top: 52px; width: 0; height: 18px; background: #fffdf6; border: 1px solid #e6d9bf; transform: translateX(-50%); transition: width 0.5s 0.25s; }
.fc-cookie:hover .half.l { transform: rotate(-4deg); }
.fc-cookie:hover .half.r { transform: rotate(4deg); }
.fc-cookie.crack .half.l { transform: translate(-26px, 10px) rotate(-28deg); }
.fc-cookie.crack .half.r { transform: translate(26px, 10px) rotate(28deg); }
.fc-cookie.crack .paper { width: 120px; }
.fc-slip { width: 100%; padding: 18px 18px 14px; border-radius: 18px; background: #fffdf6; border: 1.5px dashed rgba(90, 70, 50, 0.25); animation: fc-pop 0.45s ease-out; }
.fc-slip.done { animation: none; }
@keyframes fc-pop { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.fc-text { margin: 4px 0 10px; font-family: var(--title-font); font-size: 21px; line-height: 1.45; }
.fc-cap-title { margin: 10px 0 6px; font-size: 14px; color: var(--ink-soft); }
.fc-capsule { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 999px; background: #fff; box-shadow: 0 2px 8px rgba(60, 40, 20, 0.1); text-align: left; }
.fc-capsule b { display: block; font-family: var(--title-font); font-size: 16px; }
.fc-capsule small { color: var(--ink-soft); font-size: 13px; }
.fc-capsule.tier-finish { background: linear-gradient(120deg, #fff6cf, #ffe2f3, #dff3ff); }
.fc-ico { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #f6ecd8; font-size: 22px; }
.fc-note { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); }
.fc-row { display: flex; justify-content: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.fc-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--accent, #0f7f76); color: #fff; font-family: var(--title-font); font-size: 15px; text-decoration: none; cursor: pointer; }
.fc-btn.ghost { background: #fff; color: var(--ink); border: 1.5px solid rgba(90, 70, 50, 0.25); }
.fc-tier { margin-bottom: 10px; }
.fc-tier-name { margin: 8px 0 6px; font-weight: 700; font-size: 14px; }
.fc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.fc-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 14px; background: #fff; text-align: center; font-size: 13px; }
.fc-cell:not(.owned) { opacity: 0.55; }
.fc-cell:not(.owned) .fc-ico { font-family: var(--title-font); color: var(--ink-soft); }
.fc-mini { min-height: 30px; padding: 0 12px; border: 1.5px solid rgba(90, 70, 50, 0.25); border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; cursor: pointer; }
.fc-mini.on { background: var(--accent, #0f7f76); border-color: transparent; color: #fff; }
.fc-gift-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 14px; }
.fc-gift-list { display: flex; flex-wrap: wrap; gap: 6px; }
.fc-chip { min-height: 34px; padding: 0 14px; border: 1.5px solid rgba(90, 70, 50, 0.25); border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; }
.fc-chip:disabled { opacity: 0.5; cursor: default; }
.fc-odds, .fc-said { margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: #fff; }
.fc-odds summary, .fc-said summary { cursor: pointer; font-weight: 700; font-size: 14px; }
.fc-odds table { width: 100%; margin: 8px 0; border-collapse: collapse; font-size: 14px; }
.fc-odds th, .fc-odds td { padding: 6px 4px; border-bottom: 1px solid rgba(90, 70, 50, 0.12); text-align: left; }
.fc-said ul { margin: 8px 0 0; padding: 0; list-style: none; }
.fc-said li { display: flex; gap: 10px; padding: 6px 0; font-size: 14px; border-bottom: 1px solid rgba(90, 70, 50, 0.1); }
.fc-said li small { flex: none; color: var(--ink-soft); }
.fc-entry { width: 100%; min-height: 46px; margin: 6px 0 4px; border: 1.5px solid rgba(90, 70, 50, 0.2); border-radius: 14px; background: #fff; color: var(--ink); font-family: var(--title-font); font-size: 16px; cursor: pointer; }
.fc-entry.new { background: #fff3d6; border-color: #e0a95a; }
#dock button.fc-new { position: relative; }
#dock button.fc-new::after { content: ''; position: absolute; top: 6px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: #e0453f; }
.preset.lim, .stk-pick.lim { position: relative; }
.preset.lim::after, .stk-pick.lim::after { content: '한정'; position: absolute; top: -6px; right: -4px; padding: 1px 5px; border-radius: 999px; background: #e0a95a; color: #fff; font-size: 10px; line-height: 1.4; }
@media (max-width: 720px) {
  #fortune { top: auto; bottom: 0; transform: translateX(-50%); width: 100vw; max-height: 86dvh; border-radius: 24px 24px 0 0; }
  .fc-text { font-size: 19px; }
}

/* 첫 접속 시험 모드: 시험 뽑기 표시 */
.fc-test { display: inline-block; margin: 0 0 8px; padding: 3px 10px; border-radius: 999px; background: #fff1d6; color: #8a5a00; font-size: 13px; }


/* ---------- 모바일 웹 (2026-12-03): 전체 화면·당겨서 새로고침 막기·길게 누르기 막기 ---------- */
html, body { height: 100%; height: 100dvh; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
#scene, #labels, #dock, #react-btn, #near-act, #menu-btn, #online-head, #popup-bar, #emotes, #fs-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { touch-action: manipulation; }
@media (pointer: coarse) {
  input, textarea, select { font-size: 16px !important; } /* 아이폰: 16px 아래면 입력할 때 화면이 확대된다 */
}
#fs-btn { position: fixed; top: calc(16px + env(safe-area-inset-top)); left: 112px; z-index: 6; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--cream); color: var(--ink); font-size: 20px; line-height: 1; box-shadow: 0 2px 8px rgba(40, 30, 20, 0.15); cursor: pointer; }
#fs-btn[hidden] { display: none; }
@media (max-width: 720px) { #fs-btn { top: calc(8px + env(safe-area-inset-top)); left: 92px; } }
body.editing #fs-btn { display: none; }
#ios-hint { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 12; transform: translateX(-50%); width: min(340px, calc(100vw - 24px)); padding: 12px 16px; border-radius: 16px; background: #2f6b4a; color: #fff; text-align: center; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }
#ios-hint p { margin: 0 0 4px; }
#ios-hint .small { font-size: 13px; opacity: 0.85; }
#ios-hint button { margin-top: 6px; padding: 6px 14px; border: 0; border-radius: 999px; background: #fff; color: #2f6b4a; }
body.kb-open #chat { bottom: calc(var(--kb, 0px) + 8px) !important; height: min(30dvh, 220px); }
body.kb-open #dock, body.kb-open #react-btn, body.kb-open #near-act, body.kb-open #emotes, body.kb-open #fs-btn { display: none !important; }
@media (max-height: 480px) and (orientation: landscape) {
  #chat { height: 34dvh; width: min(300px, 38vw); }
  #online:not(.open) #online-list { display: none; }
  #online:not(.open) #online-head { margin-bottom: 0; }
  #online-count { cursor: pointer; }
  #popup-bar .pb-title { display: none; }
  #topic-pill { top: calc(62px + env(safe-area-inset-top)); font-size: 13px; }
  #fireq-card { bottom: calc(76px + env(safe-area-inset-bottom)); }
  #dock { left: auto; right: 8px; width: auto; }
  #dock button { min-height: 44px; padding: 4px 10px; }
  #react-btn { bottom: calc(62px + env(safe-area-inset-bottom)); }
}

/* ---------- 오늘의 주제 · 질문 카드 · 짝 캡슐 (로씨님 조언) ---------- */
#topic-pill { position: fixed; top: calc(70px + env(safe-area-inset-top)); left: 50%; z-index: 5; transform: translateX(-50%); max-width: min(560px, calc(100vw - 24px)); padding: 6px 16px; border-radius: 999px; background: #2f6b4a; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 3px 10px rgba(40, 30, 20, 0.18); pointer-events: none; }
#topic-pill[hidden] { display: none; }
@media (max-width: 720px) { #topic-pill { top: calc(108px + env(safe-area-inset-top)); left: 8px; right: 8px; transform: none; max-width: none; text-align: center; font-size: 13px; } }
.tips-topic { margin: 4px 0 8px; padding: 8px 12px; border-radius: 12px; background: #e6f3ee; color: #1f5a49; font-weight: 600; }
.topic-box { margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: #e6f3ee; }
.topic-box.pair { background: #fff1d6; }
.topic-box p { margin: 2px 0; }
.topic-box .tb-label { font-size: 13px; color: #5a4632; }
.topic-box .tb-text { font-family: var(--title-font, Jua); font-size: 18px; color: #2b1d12; }
#fireq-card { position: fixed; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 9; transform: translateX(-50%); width: min(420px, calc(100vw - 24px)); padding: 16px 18px 14px; border-radius: 20px; background: #fffaf0; border: 2px solid #e8c063; box-shadow: 0 10px 28px rgba(40, 30, 20, 0.25); text-align: center; }
#fireq-card[hidden] { display: none; }
#fireq-card p { margin: 0 0 6px; }
#fireq-card .fq-head { font-size: 13px; color: #7d6a52; }
#fireq-card .fq-q { font-family: var(--title-font, Jua); font-size: 22px; line-height: 1.35; color: #2b1d12; }
#fireq-card .fq-by { font-size: 13px; color: #7d6a52; }
#fireq-card .fq-again { min-height: 40px; padding: 6px 16px; border: 1.5px solid #0f7f76; border-radius: 999px; background: #fff; color: #0b6b63; cursor: pointer; }
#fireq-card .fq-close { position: absolute; top: 6px; right: 8px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 22px; cursor: pointer; }
#topic-btn[hidden], #topic-panel[hidden] { display: none; }
#topic-panel { position: fixed; top: 50%; left: 50%; z-index: 30; width: min(420px, calc(100vw - 24px)); display: flex; flex-direction: column; transform: translate(-50%, -50%); border-radius: 20px; background: var(--cream); box-shadow: 0 12px 36px rgba(40, 30, 20, 0.25); }
#topic-panel .ci-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; }
#topic-panel h2 { margin: 0; font-size: 20px; }
#topic-panel .ci-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; cursor: pointer; }
#topic-panel .ci-body { display: flex; flex-direction: column; gap: 10px; padding: 0 18px 18px; }
#topic-panel .tpc-actions { display: flex; align-items: center; gap: 12px; }
#topic-panel .pb-go { min-height: 42px; padding: 8px 20px; border: 0; border-radius: 999px; background: #0f7f76; color: #fff; font-family: var(--title-font, Jua); font-size: 16px; cursor: pointer; }

/* 운영자 인증 코드 (C-PLZ-016) */
#vcode-panel[hidden], #vcode-use[hidden], #vcode-btn[hidden], #vcode-use-btn[hidden] { display: none; }
#vcode-panel, #vcode-use { position: fixed; top: 50%; left: 50%; z-index: 30; width: min(440px, calc(100vw - 24px)); max-height: min(82vh, 640px); display: flex; flex-direction: column; transform: translate(-50%, -50%); border-radius: 20px; background: var(--cream); box-shadow: 0 12px 40px rgba(40, 30, 20, 0.28); }
#vcode-use { width: min(360px, calc(100vw - 24px)); }
:is(#vcode-panel, #vcode-use) .ci-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; }
:is(#vcode-panel, #vcode-use) h2 { margin: 0; font-size: 20px; }
:is(#vcode-panel, #vcode-use) .ci-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; cursor: pointer; }
:is(#vcode-panel, #vcode-use) .ci-body { display: flex; flex-direction: column; gap: 10px; padding: 0 18px 18px; overflow-y: auto; }
#vcode-use .pb-go { align-self: flex-start; min-height: 44px; padding: 8px 22px; border: 0; border-radius: 999px; background: #0f7f76; color: #fff; font-family: var(--title-font, Jua); font-size: 16px; cursor: pointer; }
.vc-input { height: 52px; padding: 0 16px; border: 1.5px solid rgba(90, 70, 50, 0.25); border-radius: 14px; background: #fffaf0; color: #2b1d12; font-family: var(--title-font, Jua); font-size: 26px; letter-spacing: 0.3em; text-align: center; }
.vc-input:focus { outline: none; border-color: #0f7f76; box-shadow: 0 0 0 3px rgba(15, 127, 118, 0.18); }
.vc-made { margin: 0; padding: 10px 12px; border-radius: 12px; background: #e7f3ef; color: #2b1d12; font-size: 15px; }
.vc-made b { font-size: 22px; letter-spacing: 0.12em; color: #0b6b63; }
.vc-made.bad, #vcode-out.bad { background: none; color: #b3261e; }
#vcode-out.good { color: #0b6b63; }
.vc-list { display: flex; flex-direction: column; gap: 6px; }
.vc-row { display: grid; grid-template-columns: 1fr auto auto auto auto; align-items: center; gap: 8px; min-height: 44px; padding: 4px 10px; border-radius: 12px; background: #fff; font-size: 14px; color: #5a4632; }
.vc-row.done { opacity: 0.55; }
.vc-id { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-code { font-size: 17px; letter-spacing: 0.1em; color: #2b1d12; }
.vc-cancel { min-height: 36px; padding: 0 12px; border: 1px solid rgba(90, 70, 50, 0.25); border-radius: 999px; background: #fff; font: inherit; cursor: pointer; }
.vc-link { align-self: flex-start; min-height: 40px; padding: 0 14px; border: 1px solid rgba(15, 127, 118, 0.4); border-radius: 999px; background: #fff; color: #0b6b63; font: inherit; font-size: 14px; cursor: pointer; }
.vc-done { color: #0b6b63; }
@media (max-width: 480px) { .vc-row { grid-template-columns: 1fr auto auto; } .vc-time { display: none; } }

/* ===== UI 점검 38 수정 (2026-12-03, Fable·Neon 교차 점검) ===== */
/* A1 Jua는 굵기 400 하나다: 억지 굵기 끄기 */
html { font-synthesis: none; }
h1, h2, h3, h4, strong, b, th, summary, .fc-tier-name { font-weight: 400; }
/* 한글 줄바꿈: 낱말 단위 */
body { word-break: keep-all; overflow-wrap: break-word; }
/* A2·A3 이름 글씨는 잉크색, 사용자 색은 썸네일 테두리·점으로. 카드 왼쪽 색 줄 없앰 */
.ccard, .cb-row { box-shadow: 0 2px 0 rgba(90, 70, 50, 0.12); border: 1px solid var(--line); }
.ccard-name { color: var(--ink) !important; }
.ccard-img, .cb-row img { box-sizing: border-box; border: 3px solid var(--cc, #7a5a44); border-radius: 50%; background: #fff; }
#online-list .on-name { color: var(--ink) !important; }
#online-list .on-name::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: var(--cc, #7a5a44); vertical-align: 1px; }
#booth-title { color: var(--ink) !important; }
#booth-title::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 50%; background: var(--cc, #7a5a44); vertical-align: 2px; }
/* A4 키보드 초점 */
:is(button, a, input, select, textarea, summary, [tabindex]):focus-visible { outline: 3px solid #0f7f76; outline-offset: 2px; }
#photo :is(button, a):focus-visible, #kicked :is(button, a):focus-visible { outline-color: #ffd36b; }
/* A4 터치 영역 44px */
#ch-btn, #stamp-btn, #chat-fold, #menu-btn, #react-btn, #online-count, .ccard button, .cb-row button, .quest button, .card-go, #cards-tabs button, .card-chips button, .pz-chip { min-height: 44px; }
#ch-btn { padding: 6px 14px; }
:is(#cards, #booth, #blind, #fortune, #goods-shop, #popup-card, #board, #wishes, #fourcut, #tp-menu) header button[aria-label*="닫기"], button[id$="-close"] { min-width: 44px; min-height: 44px; }
#gate button { min-height: 44px; }
/* A5 부스 창 맨 위 프로필 임베드가 안 떠도 빈 검은 상자로 보이지 않게 */
#booth .th-embed, #profile .th-embed { background: #fff9e6; border-radius: 12px; color-scheme: light; }
/* A6 휴대폰 모닥불 일어나기 버튼 (주 버튼 줄 위, 질문 카드 버튼 옆) */
#near-act2 { position: fixed; right: 16px; bottom: 84px; z-index: 6; min-height: 48px; padding: 10px 20px; border: 2px solid #0f7f76; border-radius: 999px; background: #fff; color: #0b6b63; font-family: var(--title-font, Jua); font-size: 16px; cursor: pointer; }
#near-act2[hidden] { display: none; }
@media (max-width: 720px) { #near-act2 { right: 12px; bottom: calc(190px + env(safe-area-inset-bottom)); } }
/* N8 부스 짓기 안내가 다른 창을 덮지 않게 */
#booth-guide { z-index: 5; }
body:has(#cards:not([hidden])) #booth-guide, body:has(#fourcut:not([hidden])) #booth-guide, body:has(#booth:not([hidden])) #booth-guide, body:has(#blind:not([hidden])) #booth-guide, body:has(#photo:not([hidden])) #booth-guide, body:has(#tp-menu:not([hidden])) #booth-guide { display: none; }
/* N9 휴대폰 세로: 채팅을 펴면 아래 누르는 버튼을 채팅 위로 */
@media (max-width: 720px) and (orientation: portrait) {
  body:has(#chat:not(.folded):not([hidden])) #near-act { bottom: calc(46dvh + env(safe-area-inset-bottom)); }
  body:has(#chat:not(.folded):not([hidden])) #near-act2 { bottom: calc(46dvh + 60px + env(safe-area-inset-bottom)); }
}
/* N10 휴대폰 가로: 반응 버튼과 새 화면 알림 자리 나누기, 창 높이 */
@media (max-height: 480px) and (orientation: landscape) {
  #react-btn { bottom: calc(76px + env(safe-area-inset-bottom)); }
  #hot-bar { top: 8px; bottom: auto; left: 50%; right: auto; transform: translateX(-50%); }
  #popup-card, #cards, #booth, #blind, #tp-menu, #fortune, #board, #wishes { top: 8px !important; bottom: 8px !important; max-height: none !important; }
}
/* N11 네컷 버튼: 같이 찍기 = 주 버튼, 혼자 = 보조 */
#fourcut-group { background: var(--accent) !important; color: #fff !important; }
#fourcut-solo { background: #fff !important; color: #0b6b63 !important; box-shadow: inset 0 0 0 2px #0f7f76 !important; }
/* B 같이 할 것: 첫 버튼만 채움 */
.together button.sec { background: #fff; color: #0b6b63; box-shadow: inset 0 0 0 2px #0f7f76; }
.together button { min-height: 44px; }
/* B 주 메뉴 그림 아이콘 */
#dock .dk-svg { display: block; width: 22px; height: 22px; }
#dock .dk-ico { display: inline-flex; align-items: center; justify-content: center; }
/* B 채널 알약: 누르는 것이니 흰 바탕 테두리 버튼 */
#ch-btn { background: #fff; color: #0b6b63; box-shadow: inset 0 0 0 2px #0f7f76; }
/* B 포춘 빈 칸·잠긴 핀·꺼진 버튼이 너무 흐린 것 */
.fc-cell:not(.owned) { opacity: 1; color: #6b5a44; background: #f6efe0; border: 1.5px dashed rgba(90, 70, 50, 0.3); }
.fc-cell:not(.owned) .fc-ico { color: #6b5a44; }
.pin:not(.got) { filter: grayscale(0.6); opacity: 0.8; box-shadow: inset 0 0 0 2px rgba(90, 70, 50, 0.3); }
button:disabled { opacity: 1 !important; color: #8a7a64 !important; background: #f1ead9 !important; border-style: dashed !important; cursor: not-allowed; }
/* B 첫 안내 줄 정렬, 스탬프 이름 */
#tips li { display: grid; grid-template-columns: 5.2em 1fr; gap: 2px 10px; align-items: baseline; }
@media (max-width: 720px) { #tips li { grid-template-columns: 1fr; } }
.stamp-name { word-break: keep-all; font-size: 12px; letter-spacing: -0.02em; }
/* B 네컷 포즈 목록: 이름 윗줄, 설명 아랫줄, 왼쪽 정렬 */
#poseset-row button { text-align: left; }
#poseset-row { max-height: none; overflow: visible; }
/* B 촬영 중에는 이름표·주 버튼 줄 숨김 */
body.shooting #labels, body.shooting #dock, body.shooting #near-act, body.shooting #near-act2, body.shooting #react-btn { visibility: hidden; }
/* B 창이 열리면 위 띠는 흐리게 (데스크톱) */
@media (min-width: 721px) {
  body:has(#cards:not([hidden])) #popup-bar, body:has(#booth:not([hidden])) #popup-bar, body:has(#blind:not([hidden])) #popup-bar { opacity: 0; pointer-events: none; }
}
/* C 보조 글자 대비, 상태 빨강, 움직임 줄이기 */
:root { --ink-soft: #6b5a44; }
.opt-note, #kicked .msg { color: #b3261e; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }
/* 확대: 페이지는 확대 가능, 3D 화면은 손가락 확대·끌기를 화면 이동에 쓴다 */
canvas { touch-action: none; }
#ch-btn { min-height: 44px !important; }
#online-list button { min-height: 40px; }

/* ---------- 가운데 알림 (2026-12-03): 운영자 전체 메시지 · 입장 환영 ---------- */
#center-banner { position: fixed; left: 50%; top: 28%; z-index: 40; max-width: min(560px, calc(100vw - 32px)); padding: 14px 22px; border-radius: 18px; background: rgba(255, 250, 240, 0.97); color: #2b1d12; text-align: center; box-shadow: 0 10px 30px rgba(40, 30, 20, 0.22); opacity: 0; transform: translate(-50%, -8px); transition: opacity 0.3s, transform 0.3s; pointer-events: none; }
#center-banner[hidden] { display: none; }
#center-banner.show { opacity: 1; transform: translate(-50%, 0); }
#center-banner p { margin: 0; line-height: 1.35; word-break: keep-all; }
#center-banner.cb-admin p { font-size: 24px; }
#center-banner.cb-join { padding: 10px 18px; }
#center-banner.cb-join p { font-size: 17px; }
#center-banner .cb-tag { display: inline-block; margin-bottom: 6px; padding: 2px 10px; border-radius: 999px; background: #0f7f76; color: #fff; font-size: 13px; }
@media (max-width: 720px) { #center-banner { top: 22%; } #center-banner.cb-admin p { font-size: 20px; } }
#announce-btn[hidden], #announce-panel[hidden] { display: none; }
#announce-panel { position: fixed; top: 50%; left: 50%; z-index: 30; width: min(420px, calc(100vw - 24px)); display: flex; flex-direction: column; transform: translate(-50%, -50%); border-radius: 20px; background: var(--cream, #fff9e6); box-shadow: 0 12px 36px rgba(40, 30, 20, 0.25); }
#announce-panel .ci-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; }
#announce-panel h2 { margin: 0; font-size: 20px; }
#announce-panel .ci-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; font-size: 24px; cursor: pointer; }
#announce-panel .ci-body { display: flex; flex-direction: column; gap: 10px; padding: 0 18px 18px; }
#announce-panel .tpc-actions { display: flex; align-items: center; gap: 12px; }
#announce-panel .pb-go { min-height: 44px; padding: 8px 20px; border: 0; border-radius: 999px; background: #0f7f76; color: #fff; font-family: var(--title-font, Jua); font-size: 16px; cursor: pointer; }
#announce-panel input { width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 14px; border: 1.5px solid rgba(90, 70, 50, 0.25); border-radius: 12px; background: #fffaf0; font: inherit; font-size: 16px; }
/* 접속자 상자 머리줄: "광장 1 ▾" 알약과 "n명"을 같은 세로 가운데에 (사용자 지적) */
#online-head { align-items: center; }
#online-count { display: inline-flex; align-items: center; min-height: 44px; line-height: 1; }

/* 썰매 경주 대기 창: 화면 가운데, 참가자 목록 (2026-12-03 사용자 요청) */
#race.lobby { top: 30%; left: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 24px)); text-align: center; }
#race.lobby .race-1 { font-size: 20px; }
#race .race-who-head { margin-top: 10px; color: var(--ink-soft, #6b5a44); font-size: 14px; }
#race .race-who { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 4px; }
#race .race-chip { padding: 5px 12px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px rgba(90, 70, 50, 0.22); font-size: 15px; }
#race .race-chip.me { box-shadow: inset 0 0 0 2px #0f7f76; color: #0b6b63; }
#race.lobby .game-btn { margin-top: 8px; }
.race-hud .rh-quit { margin-top: 8px; min-height: 40px; }
@media (max-width: 700px) { #race.lobby { top: 34%; } }

/* 블라인드 갤러리: 벽에 건 액자 느낌 (2026-12-03 사용자 "벽에 걸려 있는 느낌") */
#blind { background:
  radial-gradient(ellipse 70% 34% at 50% 0, rgba(255, 236, 190, 0.85), rgba(255, 236, 190, 0) 72%),
  repeating-linear-gradient(90deg, rgba(120, 90, 60, 0.035) 0 2px, rgba(0, 0, 0, 0) 2px 26px),
  #efe4d1 !important; }
.blind-wall { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 22px 6px 4px; }
.blind-wall::before { content: ''; position: absolute; top: 4px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: #6b5a44; box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); }
.blind-frame { width: 100%; padding: 11px; border-radius: 3px; background: linear-gradient(145deg, #c79453 0%, #8a5a2b 40%, #b8834c 70%, #7a4c22 100%); box-shadow: 0 14px 26px rgba(50, 30, 12, 0.32), 0 2px 4px rgba(50, 30, 12, 0.25), inset 0 0 0 2px rgba(255, 228, 176, 0.35); }
.blind-mat { padding: 12px; background: #fbf8f1; box-shadow: inset 0 2px 6px rgba(40, 25, 10, 0.22); }
.blind-frame .blind-crop { border-radius: 0; height: min(340px, calc(100dvh - 400px)); min-height: 220px; }
.blind-label { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; padding: 8px 16px; min-width: 60%; border: 1px solid rgba(90, 70, 50, 0.16); border-radius: 2px; background: #fffdf8; box-shadow: 0 2px 6px rgba(50, 30, 12, 0.12); text-align: center; color: var(--ink); }
.blind-label b { font-size: 16px; font-weight: 400; }
.blind-label span { font-size: 13px; color: #6b5a44; }
.blind-label.reveal { align-self: center; margin: 4px 0 6px; }
.blind-label.reveal .blind-who { font-size: 20px; }
#blind .blind-row { background: #efe4d1; }
#blind .blind-mine { background: rgba(255, 253, 248, 0.7); }
@media (max-width: 720px) {
  .blind-frame { padding: 8px; }
  .blind-mat { padding: 8px; }
  .blind-frame .blind-crop { height: min(340px, 46dvh); }
}

/* 포춘쿠키 깨기: 3D 쿠키 모델(검수 41)을 미리 그린 9장 띠 (2026-12-03) */
.fc-cookie { width: 200px; height: 141px; }
.fc-cookie .fc-cookie-3d { position: absolute; inset: 0; background: url(/assets/fortune/cookie_crack.png) 0 0 / 900% 100% no-repeat; transition: transform 0.3s; }
.fc-cookie:hover .fc-cookie-3d { transform: rotate(-3deg) scale(1.03); }
.fc-cookie.crack .fc-cookie-3d { animation: fc-crack3d 0.6s steps(8, end) forwards; }
@keyframes fc-crack3d { from { background-position: 0 0; } to { background-position: 100% 0; } }
.fc-cookie .paper { top: 92px; z-index: 1; opacity: 0; box-shadow: 0 1px 3px rgba(60, 40, 20, 0.2); }
.fc-cookie.crack .paper { width: 112px; opacity: 1; transition: width 0.45s 0.35s, opacity 0.1s 0.35s; }
@media (prefers-reduced-motion: reduce) { .fc-cookie.crack .fc-cookie-3d { animation: none; background-position: 100% 0; } }

/* ---------- 상호작용 1단계 (2026-12-03): 창 등장, 버튼 눌림 ----------
   창은 hidden이 풀릴 때 아래에서 살짝 올라오며 나타난다(0.2초). 위치용 transform과 겹치지 않게 translate·scale 속성을 쓴다.
   버튼은 누르는 순간 살짝 눌린다. 움직임 줄이기 설정이면 모두 끈다. */
:where(#menu-pop, #blind, #layout-panel, #tp-menu, #profile, #board, #fourcut, #cards, #game, #mascot, #card-ask,
  #shoot-invite, #booth, #photo-deco, #wishes, #tips, #fortune, #booth-guide, #topic-panel, #prebooth-panel,
  #cardimg-panel, #verify-panel, #broadcast-panel, #goods-panel, #fireq-card) {
  transition: opacity 0.2s ease, translate 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), scale 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@starting-style {
  :where(#menu-pop, #blind, #layout-panel, #tp-menu, #profile, #board, #fourcut, #cards, #game, #mascot, #card-ask,
    #shoot-invite, #booth, #photo-deco, #wishes, #tips, #fortune, #booth-guide, #topic-panel, #prebooth-panel,
    #cardimg-panel, #verify-panel, #broadcast-panel, #goods-panel, #fireq-card) {
    opacity: 0;
    translate: 0 10px;
    scale: 0.98;
  }
}
/* 메뉴 팝업은 위에서 내려온다 */
@starting-style { #menu-pop, #ch-menu { opacity: 0; translate: 0 -8px; } }
#menu-pop, #ch-menu { transition: opacity 0.16s ease, translate 0.18s ease; }

button, .btn, [role="button"] { transition: scale 0.08s ease, filter 0.12s ease, background-color 0.15s ease, box-shadow 0.15s ease; }
button:not(:disabled):active, .btn:active, [role="button"]:active { scale: 0.96; filter: brightness(0.96); }
@media (hover: hover) {
  button:not(:disabled):hover { filter: brightness(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  button:active { scale: none; }
}

/* ---------- PC 넓은 창 (2026-12-03): 휴대폰 폭으로 만든 창이 PC에서 좁고 길게 보이던 것 정리 ---------- */
.mc-side, .mc-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
@media (min-width: 1000px) and (min-height: 600px) {
  #cards { width: min(880px, calc(100vw - 48px)); }
  /* 부스 찾기·카드첩 목록: 한 줄 구조, 2열 */
  .cb-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cb-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .cb-row .cb-head { flex: 1; min-width: 0; }
  .cb-row .ccard-acts { flex-shrink: 0; }
  .cb-row > .cb-embed { flex-basis: 100%; }
  /* 내 카드: 왼쪽 카드 미리보기(따라 내려옴), 오른쪽 입력 */
  .card-form { display: grid; grid-template-columns: 300px minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .card-form > .plot-pick { grid-column: 1 / -1; }
  .mc-side { position: sticky; top: 0; }
  .mc-preview canvas { max-width: 290px; }
}
@media (min-width: 1200px) and (min-height: 760px) {
  /* 놀기·미션: 넓히고 2단, 높이는 내용만큼 */
  #popup-card { width: min(800px, calc(100vw - 32px)); bottom: auto; max-height: calc(100dvh - 104px); }
  #card-body { column-count: 2; column-gap: 28px; column-rule: 1px solid var(--line, #eadfca); }
  #card-body > * { break-inside: avoid; }
  #card-body > h3 { break-after: avoid; }
  #card-body > h3:first-of-type, #card-body > .card-period { margin-top: 6px; }
}

/* 휴대폰 (2026-12-03 모바일 점검): 블라인드 임베드가 액자 안에서 오른쪽이 잘림(274px < 스레드 임베드 최소 326px) → 여백을 줄여 330px 확보 */
@media (max-width: 420px) {
  #blind { width: calc(100vw - 12px) !important; padding-left: 6px !important; padding-right: 6px !important; }
  #blind-body { padding-left: 4px !important; padding-right: 4px !important; }
  .blind-wall { padding-left: 0; padding-right: 0; }
  .blind-frame { padding: 5px; }
  .blind-mat { padding: 2px; }
}
/* 부스 찾기 목록: 휴대폰도 한 줄(얼굴·아이디 왼쪽, [부스 가기] 오른쪽) — 한 칸 높이 약 절반 */
.cb-row { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.cb-row .cb-head { flex: 1; min-width: 0; }
.cb-row .ccard-acts { flex-shrink: 0; }
.cb-row > .cb-embed { flex-basis: 100%; }
.cb-row .cb-intro { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
