:root {
  /* 크리스마스 카드 같은 화면: 크랜베리 빨강 리본 간판, 크림색 선물 태그, 전나무 초록 화환,
     사탕지팡이 줄무늬와 꼬마전구. 세로(휴대폰) 화면이 기본이고, 넓은 화면에서는 위 카드가 양옆으로 갈라져 가운데 트리를 비워 둡니다. */
  --red: #c8363d;
  --red-light: #dc4a50;
  --red-deep: #861f26;
  --pine: #1f5c41;
  --pine-light: #2b7a56;
  --pine-deep: #123a29;
  --cream: #fff7e8;
  --cream-deep: #f1e1c2;
  --gold: #f3c14e;
  --gold-deep: #b6831c;
  --cocoa: #4a2b20;
  --cocoa-soft: #7d5c4c;
  --night: #0d1733;
  --font-display: "Jua", "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-body: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-pen: "Nanum Pen Script", "Gowun Dodum", cursive;
  --font-script: "Mountains of Christmas", "Jua", cursive;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --snowcap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='16' viewBox='0 0 64 16'%3E%3Cpath d='M0 0h64v7c-4 0-5 7-10 7s-6-6-11-6-6 8-12 8-6-7-11-7-5 5-10 5S4 7 0 7z' fill='%23ffffff'/%3E%3C/svg%3E");
  --wire: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='12'%3E%3Cpath d='M0 1Q17 11 34 1' stroke='%23233628' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  --candy: repeating-linear-gradient(-45deg, var(--red) 0 7px, #fffaf2 7px 14px);
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--night);
  color: var(--cocoa);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;
}
h1, h2, p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

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

/* ---------------- 이름표 (작은 선물 태그) ---------------- */
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.name-tag {
  position: absolute; left: 0; top: 0;
  padding: 2px 9px 3px;
  border-radius: 8px;
  background: var(--cream);
  color: var(--cocoa);
  border: 1.5px solid var(--cream-deep);
  font-family: var(--font-display);
  font-size: 13px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  will-change: transform;
}
.name-tag.me { background: var(--red); color: var(--cream); border-color: var(--red-deep); }
.name-tag.snow {
  background: rgba(31, 92, 65, 0.5);          /* 반투명 초록 */
  color: var(--cream);
  border-color: rgba(255, 247, 232, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  font-size: 14px;
  padding: 3px 11px 4px;
}

/* ---------------- 위쪽 ---------------- */
.hud-top {
  position: fixed;
  top: calc(16px + var(--safe-top));
  left: 12px; right: 12px;
  margin: 0 auto;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  pointer-events: none;
  z-index: 10;
}
.hud-top > * { pointer-events: auto; }

/* 빨간 리본 간판 + 눈 덮인 윗면 + 꼬마전구 */
.banner {
  position: relative;
  padding: 13px 14px 11px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--red-light), var(--red) 55%, #b42f36);
  color: var(--cream);
  box-shadow: 0 5px 0 var(--red-deep), 0 12px 26px rgba(40, 6, 10, 0.35);
}
.banner::before {
  content: "";
  position: absolute; left: -3px; right: -3px; top: -7px;
  height: 17px;
  background: var(--snowcap) repeat-x 0 0 / 64px 16px;
  border-radius: 12px 12px 0 0;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.08));
}
.banner-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.banner h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
  text-wrap: balance;
  text-shadow: 0 2px 0 rgba(90, 14, 20, 0.45);
}
.status { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #ffe6dc; margin-top: 3px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #ffd9cf; flex: none; }
.dot.open { background: #8ff0b4; box-shadow: 0 0 8px #8ff0b4; }
.dot.connecting, .dot.closed { background: var(--gold); animation: blink 1.2s infinite; }
.dot.offline { background: #f0c9c0; }

.bauble-btn {
  position: relative;
  flex: none;
  width: 40px; height: 40px;
  margin-top: 4px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 34% 30%, #fff6cf, var(--gold) 45%, var(--gold-deep));
  box-shadow: 0 3px 0 rgba(90, 14, 20, 0.45);
  display: grid; place-items: center;
  cursor: pointer;
}
.bauble-btn::before {
  content: ""; position: absolute; top: -6px; left: 50%;
  width: 12px; height: 7px; transform: translateX(-50%);
  border-radius: 2px; background: #c9a24a;
}
.bauble-btn svg { width: 20px; height: 20px; fill: #6b3b12; }
.bauble-btn:hover { filter: brightness(1.06); }

.round-btn {
  flex: none;
  width: 36px; height: 36px;
  margin-top: 4px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 247, 232, 0.94);
  color: var(--red-deep);
  box-shadow: 0 3px 0 rgba(90, 14, 20, 0.45);
  display: grid; place-items: center;
  cursor: pointer;
}
.round-btn svg { width: 19px; height: 19px; }
.round-btn:hover { background: #fff; }
.banner-row h1 { flex: 1; min-width: 0; }

.bulb-string {
  position: absolute; left: 12px; right: 12px; bottom: -19px;
  height: 22px;
  display: flex; justify-content: center;
  background: var(--wire) repeat-x center top / 34px 12px;
  pointer-events: none;
}
.bulb-string i {
  position: relative;
  flex: none;
  width: 34px; height: 22px;
  --b: #ff5a4e;
}
.bulb-string i::before {
  content: ""; position: absolute; left: 14.5px; top: 4px;
  width: 5px; height: 4px; border-radius: 1px; background: #3a3f3a;
}
.bulb-string i::after {
  content: ""; position: absolute; left: 13px; top: 7px;
  width: 8px; height: 12px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: var(--b);
  box-shadow: 0 0 9px var(--b), 0 0 2px #fff inset;
  animation: twinkle 2.4s ease-in-out infinite;
}
.bulb-string i:nth-child(4n+2) { --b: #ffd34e; }
body.lights-out .bulb-string i::after { background: #4a4f5c; box-shadow: none; animation: none; transition: background .8s; }
.bulb-string i:nth-child(4n+3) { --b: #57d68d; }
.bulb-string i:nth-child(4n+4) { --b: #5aa8ff; }
.bulb-string i:nth-child(3n+1)::after { animation-delay: -0.8s; }
.bulb-string i:nth-child(3n+2)::after { animation-delay: -1.6s; }

/* 크림색 선물 태그 */
.goal {
  position: relative;
  padding: 13px 16px 12px 24px;
  border-radius: 14px;
  background: var(--cream);
  color: var(--cocoa);
  box-shadow: 0 5px 0 var(--cream-deep), 0 12px 26px rgba(10, 16, 40, 0.3);
  outline: 2px dashed rgba(200, 54, 61, 0.35);
  outline-offset: -7px;
  display: grid; gap: 4px;
}
.goal::before {
  content: ""; position: absolute; left: 9px; top: 50%;
  width: 7px; height: 7px; transform: translateY(-50%);
  border-radius: 50%;
  border: 2.5px solid var(--gold-deep);
  background: var(--night);
}
.goal-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.goal-count { display: flex; align-items: baseline; gap: 6px; }
.goal-count b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 32px;
  line-height: 1;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.goal-count span { font-size: 13.5px; color: var(--cocoa-soft); }
.goal-next { font-family: var(--font-display); font-size: 14.5px; color: var(--pine); }

.track {
  position: relative;
  height: 16px;
  margin: 12px;
  border-radius: 999px;
  background: #f3e4c6;
  box-shadow: inset 0 2px 3px rgba(74, 43, 32, 0.18);
}
.fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: var(--candy);
  background-size: 19.8px 19.8px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.12), 0 0 0 1.5px rgba(134, 31, 38, 0.35);
  animation: candy 1.4s linear infinite;
  transition: width 0.9s cubic-bezier(.2, .8, .2, 1);
}
.marker {
  position: absolute; top: 50%;
  width: 26px; height: 26px;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--cream);
  border: 2px solid #e2cfa6;
  transition: border-color .4s, box-shadow .4s, background .4s;
}
.marker svg { width: 14px; height: 14px; fill: #c9b896; transition: fill .4s; }
.marker.on { --m: #ffc93c; background: #fffdf6; border-color: var(--m); box-shadow: 0 0 12px var(--m); }
.marker.on svg { fill: var(--m); }
.marker.bulb.c1.on { --m: #ff5a4e; }
.marker.bulb.c2.on { --m: #2fbf73; }
.marker.bulb.c3.on { --m: #3f8fe6; }
.marker.star { width: 32px; height: 32px; }
.marker.star svg { width: 18px; height: 18px; }
.marker.star.on { --m: var(--gold); background: #fff3c4; }
.marker.star.on svg { fill: #e0a21a; }

.ceremony { display: flex; align-items: center; gap: 8px; font-size: 13.5px; flex-wrap: wrap; }
.ceremony-label {
  padding: 2px 9px 3px;
  border-radius: 999px;
  background: var(--pine);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 12.5px;
}
.ceremony .left {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.ceremony .left.done { color: var(--pine); }
.link-btn {
  background: none; border: 0; padding: 0;
  color: var(--red); text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer; font-size: 13px;
}

/* ---------------- 아래쪽 ---------------- */
.hud-bottom {
  position: fixed;
  left: 10px; right: 10px;
  bottom: calc(12px + var(--safe-bottom));
  margin: 0 auto;
  max-width: 520px;
  display: grid;
  justify-items: center;
  gap: 12px;
  z-index: 10;
}
/* 전나무 화환 */
.emotes {
  display: flex; gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background:
    radial-gradient(circle, #e2483d 0 2.2px, transparent 2.8px) 6px 3px / 23px 100% repeat-x,
    linear-gradient(180deg, var(--pine-light), var(--pine) 60%, var(--pine-deep));
  box-shadow: 0 4px 0 var(--pine-deep), 0 10px 22px rgba(0, 0, 0, 0.3);
  border: 2px solid #3a8f63;
}
.emote {
  position: relative;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 40% 35%, #ffffff, var(--cream) 60%, #efdcb8);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .15s;
}
.emote .emoji { font-size: 22px; line-height: 1; }
.emote .emote-name {
  position: absolute; bottom: calc(100% + 9px); left: 50%;
  transform: translateX(-50%);
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--cream);
  color: var(--cocoa);
  font-size: 12px; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  opacity: 0; pointer-events: none;
  transition: opacity .15s;
}
.emote:hover { transform: translateY(-3px) rotate(-4deg); }
.emote:hover .emote-name, .emote:focus-visible .emote-name { opacity: 1; }
.emote:active { transform: scale(.92); }
.emotes.cooling .emote { opacity: .6; }
@media (hover: none) { .emote .emote-name { display: none; } }

.actions { display: flex; gap: 10px; width: 100%; }
.actions .btn { flex: 1; }
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px 12px;
  border-radius: 16px;
  border: 0;
  font-family: var(--font-display);
  font-size: 17px;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, filter .15s;
  white-space: nowrap;
}
.btn::before {
  content: "";
  position: absolute; left: 6px; right: 6px; top: -5px;
  height: 12px;
  background: var(--snowcap) repeat-x 0 0 / 48px 12px;
  border-radius: 10px 10px 0 0;
  pointer-events: none;
}
.btn svg { width: 22px; height: 22px; }
.btn.red {
  background: linear-gradient(180deg, var(--red-light), var(--red));
  color: var(--cream);
  box-shadow: 0 5px 0 var(--red-deep), 0 12px 24px rgba(134, 31, 38, 0.35);
  text-shadow: 0 1px 0 rgba(90, 14, 20, 0.5);
}
.btn.pine {
  background: linear-gradient(180deg, var(--pine-light), var(--pine));
  color: var(--cream);
  box-shadow: 0 5px 0 var(--pine-deep), 0 12px 24px rgba(10, 40, 26, 0.35);
}
.btn:hover { filter: brightness(1.07); }
.btn.gold {
  background: linear-gradient(180deg, #ffe08a, var(--gold));
  color: var(--red-deep);
  box-shadow: 0 5px 0 var(--gold-deep), 0 12px 24px rgba(120, 80, 10, 0.35);
}
.btn.gold:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--gold-deep); }
.btn.red:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--red-deep); }
.btn.pine:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--pine-deep); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; filter: none; }

.hint {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(150px + var(--safe-bottom));
  margin: 0 auto;
  width: fit-content;
  max-width: min(460px, calc(100% - 32px));
  padding: 9px 15px;
  border-radius: 14px;
  background: var(--cream);
  color: var(--cocoa);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  font-size: 13.5px;
  text-align: center;
  line-height: 1.5;
  transition: opacity .5s;
  z-index: 9;
  pointer-events: none;
}
.hint.gone { opacity: 0; }

/* ---------------- 조이스틱 (휴대폰) ---------------- */
.joystick {
  display: none;
  position: fixed;
  left: 16px;
  bottom: calc(84px + var(--safe-bottom));
  width: 116px; height: 116px;
  border-radius: 50%;
  background:
    radial-gradient(circle, transparent 54%, rgba(255, 255, 255, 0.5) 55%, rgba(255, 255, 255, 0.5) 58%, transparent 59%),
    radial-gradient(circle at 50% 40%, rgba(255, 247, 232, 0.32), rgba(255, 247, 232, 0.14));
  border: 3px solid rgba(255, 247, 232, 0.75);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  touch-action: none;
  z-index: 11;
}
.joy-knob {
  position: absolute; left: 50%; top: 50%;
  width: 50px; height: 50px;
  margin: -25px 0 0 -25px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #fff, var(--cream) 50%, #e8d2a8);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25), 0 0 0 3px var(--red);
  transition: transform .12s ease-out;
}
.joystick.active .joy-knob { transition: none; }
body.touch.entered:not(.tree-mode) .joystick { display: block; }
body.touch.entered:not(.tree-mode) .hud-bottom .emotes { justify-self: end; }
body.touch.entered:not(.tree-mode) .emote { width: 40px; height: 40px; }
body.touch.entered:not(.tree-mode) .emote .emoji { font-size: 19px; }
body.touch.entered:not(.tree-mode) .hint { bottom: calc(214px + var(--safe-bottom)); }
body.touch.entered:not(.tree-mode) .toasts { bottom: calc(220px + var(--safe-bottom)); }

/* ---------------- 눈덩이 들기 ---------------- */
.drop-btn {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(150px + var(--safe-bottom));
  margin: 0 auto;
  width: fit-content;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 10px;
  border-radius: 999px;
  border: 2px solid var(--cream-deep);
  background: var(--cream);
  color: var(--cocoa);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.18), 0 10px 22px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  z-index: 11;
}
.drop-btn svg { width: 34px; height: 34px; flex: none; }
.drop-btn.grab { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(243, 193, 78, 0.45), 0 5px 0 rgba(0, 0, 0, 0.18), 0 10px 22px rgba(0, 0, 0, 0.28); animation: grab-pulse 1.6s ease-in-out infinite; }
.drop-btn.grab .drop-text b { color: var(--pine); }
@keyframes grab-pulse { 50% { box-shadow: 0 0 0 7px rgba(243, 193, 78, 0.2), 0 5px 0 rgba(0, 0, 0, 0.18), 0 10px 22px rgba(0, 0, 0, 0.28); } }
.drop-text { display: grid; text-align: left; line-height: 1.25; }
.drop-text b { font-family: var(--font-display); font-weight: 400; font-size: 16px; color: var(--red); }
.drop-text span { font-size: 12.5px; color: var(--cocoa-soft); }
body.touch.entered:not(.tree-mode) .drop-btn { left: auto; right: 12px; margin: 0; bottom: calc(158px + var(--safe-bottom)); }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) { .drop-btn { bottom: calc(100px + var(--safe-bottom)); } }

/* ---------------- 앉기 · 마시멜로 ---------------- */
.seat-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(150px + var(--safe-bottom));
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 0 12px;
  pointer-events: none;
  z-index: 11;
}
.seat-bar[hidden] { display: none; }
.seat-bar .drop-btn { position: static; margin: 0; pointer-events: auto; }
.seat-bar .drop-btn[hidden] { display: none; }
.mallow-btn .drop-text b { color: #a8642c; }
.warm-btn .drop-text b { color: #c9521e; }
.btn-emoji { font-size: 22px; line-height: 1; width: 26px; text-align: center; flex: none; }
.buy-btn .drop-text b { color: #b8322f; }
.use-btn .drop-text b { color: #a8642c; }
.buy-btn { border-color: #e7b9a2; }
.pet-btn .drop-text b { color: #b8743a; }
.pet-btn.sleeping { opacity: 0.72; cursor: default; filter: saturate(0.6); }
.pet-btn.sleeping .drop-text b { color: #7c7f9a; }
.mallow-btn.ready { border-color: var(--gold); animation: grab-pulse 1.2s ease-in-out infinite; }
body.touch.entered:not(.tree-mode) .seat-bar { left: auto; right: 12px; padding: 0; flex-direction: column; align-items: flex-end; bottom: calc(158px + var(--safe-bottom)); }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) { .seat-bar { bottom: calc(100px + var(--safe-bottom)); } }
body.ui-hidden .seat-bar, body.tree-mode .seat-bar { display: none !important; }
/* 버튼이 떠 있으면 안내 문구·알림은 그 위로 */
body:has(#seatBar:not([hidden])) .hint, body:has(#dropBtn:not([hidden])) .hint { bottom: calc(214px + var(--safe-bottom)); }
body.touch.entered:not(.tree-mode):has(#seatBar:not([hidden])) .hint { bottom: calc(300px + var(--safe-bottom)); }
body.touch.entered:not(.tree-mode):has(#seatBar:not([hidden])) .toasts { bottom: calc(306px + var(--safe-bottom)); }
body.touch.entered:not(.tree-mode):has(#warmBtn:not([hidden])) .hint, body.touch.entered:not(.tree-mode):has(#useBtn:not([hidden])) .hint { bottom: calc(370px + var(--safe-bottom)); }
body.touch.entered:not(.tree-mode):has(#warmBtn:not([hidden])) .toasts, body.touch.entered:not(.tree-mode):has(#useBtn:not([hidden])) .toasts { bottom: calc(376px + var(--safe-bottom)); }

/* ---------------- 화면 표시 숨기기 ---------------- */
.show-ui {
  display: none;
  position: fixed;
  top: calc(14px + var(--safe-top)); right: 14px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 247, 232, 0.55);
  color: var(--red-deep);
  cursor: pointer;
  z-index: 12;
}
.show-ui svg { width: 22px; height: 22px; }
.show-ui:hover { background: rgba(255, 247, 232, 0.9); }
body.ui-hidden .show-ui { display: grid; place-items: center; }
body.ui-hidden .hud-top,
body.ui-hidden .hud-bottom,
body.ui-hidden .hint,
body.ui-hidden #labels,
body.ui-hidden .joystick,
body.ui-hidden .toasts,
body.ui-hidden .tooltip,
body.ui-hidden .drop-btn { display: none !important; }

/* ---------------- 알림 / 툴팁 ---------------- */
.toasts {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(158px + var(--safe-bottom));
  margin: 0 auto;
  width: min(420px, calc(100% - 32px));
  display: grid; gap: 8px; justify-items: center;
  z-index: 30;
  pointer-events: none;
}
.toast {
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--cocoa);
  border: 2px solid var(--cream-deep);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  font-size: 14px;
  text-align: center;
  animation: toast-in .35s cubic-bezier(.2, .8, .2, 1);
  transition: opacity .4s, transform .4s;
}
.toast.gold {
  background: linear-gradient(180deg, var(--red-light), var(--red));
  color: var(--cream);
  border-color: var(--red-deep);
  font-family: var(--font-display);
  font-size: 15.5px;
}
.toast.out { opacity: 0; transform: translateY(6px); }

.tooltip {
  position: fixed; left: 0; top: 0;
  max-width: 260px;
  padding: 14px 13px 8px;
  border-radius: 12px;
  background: var(--candy) top / 100% 6px no-repeat, var(--cream);
  color: var(--cocoa);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 40;
}
.tip-msg { font-family: var(--font-pen); font-size: 23px; line-height: 1.1; overflow-wrap: anywhere; }
.tip-nick { font-size: 12px; color: var(--cocoa-soft); margin-top: 4px; text-align: right; }

/* ---------------- 점등식 ---------------- */
.big-count {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 34vmin;
  color: #fff7dd;
  text-shadow: 0 0 30px rgba(243, 193, 78, 0.95), 0 0 90px rgba(200, 54, 61, 0.7);
  pointer-events: none;
  z-index: 20;
}
.big-count.pulse { animation: count-pulse 1s ease-out; }
.big-notice {
  position: fixed; left: 0; right: 0; top: 46%;
  margin: 0 auto; width: fit-content;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(200, 54, 61, 0.92);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: clamp(19px, 3.6vw, 28px);
  box-shadow: 0 0 30px rgba(243, 193, 78, 0.5);
  pointer-events: none;
  animation: breathe 2.4s ease-in-out infinite;
  z-index: 20;
  white-space: nowrap;
}
.celebrate {
  position: fixed; left: 0; right: 0; top: 30%;
  margin: 0 auto;
  width: calc(100% - 32px);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .9s, transform .9s;
  z-index: 20;
}
.celebrate.show { opacity: 1; transform: none; }
.cel-title {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(52px, 11vw, 112px);
  line-height: 1;
  color: #fff4cf;
  text-shadow: 0 0 22px rgba(243, 193, 78, 0.95), 0 0 60px rgba(200, 54, 61, 0.8), 0 3px 0 var(--red-deep);
}
.cel-sub {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--cream);
  color: var(--cocoa);
  font-family: var(--font-display);
  font-size: clamp(15px, 2.4vw, 20px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.cel-sub:empty { display: none; }
body.flash::after {
  content: "";
  position: fixed; inset: 0;
  background: #fff4d6;
  pointer-events: none;
  animation: flash 1.6s ease-out forwards;
  z-index: 25;
}

/* ---------------- 창 (산타에게 쓰는 편지지) ---------------- */
.modal {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 14px;
  background: rgba(20, 8, 12, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 50;
}
.sheet {
  position: relative;
  width: min(440px, 100%);
  max-height: calc(100% - 8px);
  overflow: auto;
  padding: 30px 22px 22px;
  border-radius: 22px;
  background: var(--candy) top / 100% 10px no-repeat, var(--cream);
  color: var(--cocoa);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  animation: pop .28s cubic-bezier(.2, .9, .3, 1.2);
}
.sheet h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 25px;
  line-height: 1.2;
  color: var(--red);
  text-wrap: balance;
  margin-bottom: 14px;
  padding-right: 34px;
}
.close {
  position: absolute; top: 20px; right: 14px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--red);
  color: var(--cream);
  font-size: 22px; line-height: 1;
  box-shadow: 0 3px 0 var(--red-deep);
  cursor: pointer;
}
.close:hover { filter: brightness(1.08); }
.script {
  font-family: var(--font-script);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  color: var(--pine);
  margin-bottom: 4px;
}
.welcome h2 { margin-bottom: 6px; }
.lead { font-size: 14.5px; color: var(--cocoa-soft); margin-bottom: 14px; line-height: 1.55; }
.steps { margin: 0 0 18px; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 9px; font-size: 14.5px; line-height: 1.55; }
.steps li { position: relative; padding-left: 32px; counter-increment: s; }
.steps li::before {
  content: counter(s);
  position: absolute; left: 0; top: 1px;
  width: 23px; height: 23px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 13px;
}
.steps b { color: var(--red); font-weight: 400; font-family: var(--font-display); }

.form { display: grid; gap: 10px; }
.form label, .form legend { font-size: 13.5px; color: var(--cocoa-soft); }
.form input:not([type="radio"]), .form textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 2px solid var(--cream-deep);
  background: #fffdf8;
  color: var(--cocoa);
  font-family: var(--font-body);
  font-size: 16px;
  resize: none;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(200, 54, 61, 0.15); }
.form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.form legend { padding: 0; margin-bottom: 8px; }
.form .btn { margin-top: 10px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.counter { font-size: 12px; color: var(--cocoa-soft); font-variant-numeric: tabular-nums; }
.form-note { font-size: 12.5px; color: var(--cocoa-soft); line-height: 1.5; }
.form-error { font-size: 13.5px; color: var(--red); }
.form-error:empty { display: none; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.55), transparent 45%), var(--c);
  border: 2px solid rgba(74, 43, 32, 0.15);
  cursor: pointer;
  transition: transform .12s;
}
.swatch:hover { transform: scale(1.08); }
input:checked + .swatch { outline: 3px solid var(--cocoa); outline-offset: 2px; }
input:focus-visible + .swatch, input:focus-visible + .shape, input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 2px; }

.shape-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.shape {
  display: grid; justify-items: center; gap: 2px;
  padding: 8px 2px 6px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #f7ead0;
  font-size: 12.5px; color: var(--cocoa-soft);
  cursor: pointer;
}
.shape:hover { background: #f3e0bd; }
input:checked + .shape { border-color: var(--red); background: #fde9e2; color: var(--cocoa); }

.seg { display: grid; gap: 6px; }
.seg label {
  padding: 10px 12px;
  border-radius: 12px;
  border: 2px solid var(--cream-deep);
  color: var(--cocoa);
  font-size: 14px;
  cursor: pointer;
}
.seg input:checked + label { border-color: var(--red); background: #fde9e2; }

/* 오너먼트 쓰기 */
.sheet.composer { width: min(460px, 100%); }
.composer-body { display: grid; gap: 14px; }
.preview {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.08), transparent 40%),
    linear-gradient(160deg, var(--pine-light), var(--pine-deep));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.06);
}
.preview-icon { flex: none; transform-origin: 50% 0; animation: swing 3.2s ease-in-out infinite; }
.preview-icon svg { width: 76px; height: 76px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4)); }
.tag {
  flex: 1;
  min-width: 0;
  padding: 10px 13px 8px;
  border-radius: 10px;
  background: #fffdf6;
  color: var(--cocoa);
  transform: rotate(-2deg);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}
.pen { font-family: var(--font-pen); font-size: 25px; line-height: 1.15; overflow-wrap: anywhere; }
.pen.placeholder { opacity: .45; }
.pen-sm { font-family: var(--font-pen); font-size: 20px; text-align: right; margin-top: 2px; min-height: 1em; }

/* 오너먼트 찾기 */
.sheet.search { width: min(460px, 100%); }
.results { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 7px; }
.result {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: #f7ead0;
  color: var(--cocoa);
  text-align: left;
  cursor: pointer;
}
.result:hover { border-color: var(--red); background: #fde9e2; }
.result.mine { background: #e7f2ea; }
.result svg { flex: none; }
.r-text { display: grid; gap: 2px; min-width: 0; }
.r-msg { font-family: var(--font-pen); font-size: 22px; line-height: 1.1; overflow-wrap: anywhere; }
.r-meta { font-size: 12px; color: var(--cocoa-soft); }
.snow-note { margin-top: 8px; }
.snow-card .card-msg.snow-name { font-family: var(--font-display); font-size: 30px; color: var(--pine); }
.snow-title { margin: 4px 0 6px !important; padding: 0 !important; text-align: center; }
.snow-form { text-align: left; }
.snow-form .card-icon { margin-bottom: 0; }
.snow-back { justify-self: center; margin-top: 4px; }
.hat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.hat-opt {
  display: grid; justify-items: center; gap: 2px;
  padding: 6px 2px 6px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #f7ead0;
  font-size: 12px; color: var(--cocoa-soft);
  cursor: pointer;
}
input:checked + .hat-opt { border-color: var(--red); background: #fde9e2; color: var(--cocoa); }
input:focus-visible + .hat-opt { outline: 3px solid var(--gold); outline-offset: 2px; }
.swatch.none { background: linear-gradient(135deg, transparent 45%, var(--red) 46%, var(--red) 54%, transparent 55%), #fffdf8; }
.code-box { margin-top: 12px; padding: 12px; border-radius: 14px; background: #f7ead0; display: grid; gap: 6px; }
.code {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: 0.08em;
  color: var(--red);
  text-align: center;
  user-select: all;
  margin: 8px 0 4px;
}
#snowDone { display: grid; gap: 8px; text-align: center; }
#snowDone[hidden] { display: none; }
#snowDone .btn { margin-top: 6px; text-decoration: none; }
.sheet.card .btn { margin-top: 14px; text-decoration: none; }

/* 오너먼트 읽기 */
.sheet.card { width: min(380px, 100%); padding: 34px 26px 24px; text-align: center; }
.card-icon { display: flex; justify-content: center; margin-bottom: 8px; }
.card-icon svg { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18)); animation: swing 3.2s ease-in-out infinite; transform-origin: 50% 0; }
.card-no {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--pine);
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 12.5px;
}
.card-msg { font-size: 35px; line-height: 1.18; margin: 12px 0 14px; color: #3a221a; }
.card-from { font-size: 14px; color: var(--cocoa-soft); }

/* 선물 */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 > div { display: grid; gap: 6px; min-width: 0; }
.row2 input { width: 100%; min-width: 0; }
.gift-to { text-align: left; margin: 0 0 4px; font-size: 22px; }
.gift-lock-note { margin: 0; font-size: 12.5px; color: var(--cocoa-soft); }
.done-panel { display: grid; gap: 8px; text-align: center; }
.done-panel[hidden] { display: none; }
.done-panel .btn { margin-top: 6px; text-decoration: none; }
.gift-card-to { font-family: var(--font-pen); font-size: 26px; margin: 10px 0 2px; color: var(--red-deep); }
.gift-msg { white-space: pre-line; font-size: 27px; margin: 12px 0; padding: 14px 12px; border-radius: 12px; background: #fff7e2; box-shadow: inset 0 0 0 2px #f1dfb6; animation: pop-in .45s cubic-bezier(.2, 1.4, .4, 1); }
.gift-state { margin-top: 10px; }
.gift-open { margin-top: 6px; text-align: left; }
.gift-open[hidden] { display: none; }
@keyframes pop-in { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- 불러오기 ---------------- */
.loading {
  position: fixed; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 16px;
  background: radial-gradient(circle at 50% 40%, var(--red-light), var(--red-deep));
  z-index: 100;
  transition: opacity .7s;
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--cream);
  text-align: center;
  padding: 24px;
}
.loading.done { opacity: 0; pointer-events: none; }
.loading-tree { width: 84px; height: 84px; animation: hop 1.2s ease-in-out infinite; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3)); }

/* ---------------- 애니메이션 ---------------- */
@keyframes blink { 50% { opacity: .35; } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes candy { to { background-position: 19.8px 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes swing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes count-pulse { from { transform: scale(1.35); opacity: .2; } 30% { opacity: 1; } to { transform: scale(1); opacity: .92; } }
@keyframes breathe { 50% { opacity: .7; } }
@keyframes flash { from { opacity: .85; } to { opacity: 0; } }

/* ---------------- 휴대폰 세로: 위 카드를 얇게 ---------------- */
@media (max-width: 899px), (max-aspect-ratio: 1/1) {
  .hud-top { gap: 20px; top: calc(14px + var(--safe-top)); }
  .banner { padding: 10px 12px 9px 14px; }
  .banner h1 { font-size: 20px; }
  .bauble-btn { width: 36px; height: 36px; }
  .status { font-size: 12.5px; margin-top: 1px; }
  .goal { padding: 10px 14px 9px 22px; gap: 2px; }
  .goal-count b { font-size: 28px; }
  .goal-next { font-size: 14px; }
  .track { margin: 10px 12px; height: 14px; }
  .marker { width: 24px; height: 24px; }
  .marker.star { width: 30px; height: 30px; }
  .actions { gap: 8px; }
  .actions .btn { font-size: 15.5px; padding: 13px 8px 11px; gap: 5px; border-radius: 14px; }
  .actions .btn svg { width: 19px; height: 19px; }
}

/* ---------------- 좁은 휴대폰 ---------------- */
@media (max-width: 380px) {
  .banner h1 { font-size: 19px; }
  .goal-count b { font-size: 27px; }
  .emote { width: 40px; height: 40px; }
  .emote .emoji { font-size: 19px; }
  .btn { font-size: 15.5px; padding: 13px 12px 11px; }
  .actions .btn { font-size: 14px; padding: 12px 5px 10px; }
  .actions .btn svg { display: none; }
}
@media (max-height: 640px) {
  .hud-top { gap: 18px; top: calc(12px + var(--safe-top)); }
  .goal-count b { font-size: 26px; }
  .track { margin: 9px 12px; }
}

/* ---------------- 넓은 화면 (PC): 위 카드는 양옆으로, 가운데는 트리 ---------------- */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .hud-top {
    max-width: none;
    left: 20px; right: 20px;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    top: calc(22px + var(--safe-top));
  }
  .banner { width: 424px; }                                       /* 🎵 버튼이 늘어서 제목이 한 줄에 들어가게 */
  .goal { width: 410px; }
  .hud-bottom {
    max-width: none;
    width: max-content;
    left: 50%; right: auto;
    transform: translateX(-50%);
    bottom: calc(20px + var(--safe-bottom));
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .actions { width: auto; }
  .actions .btn { flex: none; }
  .hint { bottom: calc(100px + var(--safe-bottom)); }
  .toasts { top: calc(24px + var(--safe-top)); bottom: auto; }
  .toast.out { transform: translateY(-6px); }
}

/* ---------------- 휴대폰(터치): 전체 UI를 작게 → 화면을 덜 가림 ---------------- */
@media (max-width: 899px), (max-aspect-ratio: 1/1) {
  body.touch .hud-top { top: calc(8px + var(--safe-top)); left: 8px; right: 8px; gap: 13px; }
  body.touch .banner { padding: 7px 9px 6px 12px; border-radius: 12px; box-shadow: 0 3px 0 var(--red-deep), 0 8px 18px rgba(40, 6, 10, 0.3); }
  body.touch .banner::before { top: -5px; height: 12px; background-size: 48px 12px; }
  body.touch .banner h1 { font-size: 16px; }
  body.touch .status { font-size: 11px; margin-top: 0; gap: 5px; }
  body.touch .dot { width: 7px; height: 7px; }
  body.touch .banner-row { gap: 6px; }
  body.touch .bauble-btn { width: 29px; height: 29px; }
  body.touch .bauble-btn svg { width: 15px; height: 15px; }
  body.touch .bulb-string { bottom: -13px; height: 15px; background-size: 24px 9px; }
  body.touch .bulb-string i { width: 24px; height: 15px; }
  body.touch .bulb-string i::before { left: 10px; top: 3px; width: 4px; height: 3px; }
  body.touch .bulb-string i::after { left: 9px; top: 5px; width: 6px; height: 9px; }
  body.touch .goal { padding: 6px 11px 6px 19px; gap: 1px; border-radius: 12px; outline-offset: -5px; box-shadow: 0 3px 0 var(--cream-deep), 0 8px 18px rgba(10, 16, 40, 0.25); }
  body.touch .goal::before { left: 7px; width: 5px; height: 5px; border-width: 2px; }
  body.touch .goal-count b { font-size: 21px; }
  body.touch .goal-count span { font-size: 11px; }
  body.touch .goal-next { font-size: 11.5px; }
  body.touch .track { margin: 7px 9px; height: 9px; }
  body.touch .marker { width: 17px; height: 17px; border-width: 1.5px; }
  body.touch .marker svg { width: 10px; height: 10px; }
  body.touch .marker.star { width: 21px; height: 21px; }
  body.touch .marker.star svg { width: 12px; height: 12px; }
  body.touch .ceremony { font-size: 11px; gap: 5px; }
  body.touch .ceremony-label { font-size: 10.5px; padding: 1px 7px 2px; }
  body.touch .ceremony .left { font-size: 14px; }
  body.touch .hud-bottom { bottom: calc(8px + var(--safe-bottom)); left: 8px; right: 8px; gap: 8px; }
  body.touch .actions { gap: 6px; }
  body.touch .actions .btn { font-size: 13px; padding: 8px 5px 7px; gap: 4px; border-radius: 11px; }
  body.touch .actions .btn svg { width: 14px; height: 14px; }
  body.touch.entered:not(.tree-mode) .emotes { padding: 4px 6px; gap: 4px; }
  body.touch.entered:not(.tree-mode) .emote { width: 33px; height: 33px; }
  body.touch.entered:not(.tree-mode) .emote .emoji { font-size: 16px; }
  body.touch .joystick { left: 10px; bottom: calc(60px + var(--safe-bottom)); width: 94px; height: 94px; border-width: 2px; }
  body.touch .joy-knob { width: 40px; height: 40px; margin: -20px 0 0 -20px; }
  body.touch.entered:not(.tree-mode) .seat-bar, body.touch.entered:not(.tree-mode) .drop-btn { right: 8px; bottom: calc(108px + var(--safe-bottom)); }
  body.touch .seat-bar { gap: 6px; }
  body.touch .drop-btn { padding: 5px 11px 5px 7px; gap: 7px; border-width: 1.5px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.16), 0 6px 14px rgba(0, 0, 0, 0.24); }
  body.touch .drop-btn svg { width: 24px; height: 24px; }
  body.touch .drop-text b { font-size: 13.5px; }
  body.touch .drop-text span { font-size: 10.5px; }
  body.touch .btn-emoji { font-size: 17px; width: 20px; }
  body.touch .hint { font-size: 12.5px; padding: 6px 11px; }
  body.touch.entered:not(.tree-mode) .hint { top: calc(var(--hud-y, 170px) + 10px); bottom: auto !important; }   /* 안내도 가운데 말고 위 카드 바로 아래 */
  /* 알림은 화면 가운데를 가리지 않게 맨 위에 작게 (위 카드 위에 잠깐 겹쳐 떴다가 사라짐, 터치는 그대로 통과) */
  body.touch .toasts { top: calc(6px + var(--safe-top)) !important; bottom: auto !important; width: min(340px, calc(100% - 20px)); gap: 5px; }
  body.touch .toast { font-size: 12.5px; padding: 6px 12px; border-width: 1.5px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
  body.touch .toast.out { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.cel-sub:empty { display: none; }

/* ---------------- 군고구마 미니게임 창 ---------------- */
.gg-btn .drop-text b { color: #8a3b2c; }
.gg-pop {
  position: fixed; left: calc(50% - 180px); top: 15vh; z-index: 30;
  width: min(360px, calc(100vw - 24px));
  background: var(--cream); color: var(--cocoa);
  border: 2px solid var(--cream-deep); border-radius: 18px;
  box-shadow: 0 10px 30px rgba(20, 12, 30, 0.35);
  padding: 10px 12px 12px;
  animation: gg-in 0.25s ease-out;
}
.gg-pop[hidden] { display: none; }
@keyframes gg-in { from { transform: translateY(-8px) scale(0.97); opacity: 0; } to { transform: none; opacity: 1; } }
.gg-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); font-size: 16px; margin-bottom: 6px; cursor: grab; touch-action: none; user-select: none; }
.gg-pop.dragging { box-shadow: 0 16px 40px rgba(20, 12, 30, 0.45); }   /* animation 은 건드리지 않음: 바꾸면 놓을 때 등장 효과가 다시 재생돼 깜빡임 */
.gg-pop.dragging .gg-head { cursor: grabbing; }
.gg-pop.docked { left: auto !important; top: 92px !important; right: 16px; width: min(250px, calc(100vw - 24px)); }
.gg-tools { display: flex; align-items: center; gap: 4px; }
.gg-dock { border: 1.5px solid var(--cream-deep); background: #fffaf1; color: var(--cocoa-soft); border-radius: 999px; font-size: 12px; padding: 3px 9px; cursor: pointer; font-family: inherit; }
.gg-dock:hover { background: #fff3df; }
.gg-x { border: 0; background: transparent; font-size: 24px; line-height: 1; color: var(--cocoa-soft); cursor: pointer; padding: 0 4px; }
.gg-pop canvas { display: block; width: 100%; height: auto; border-radius: 12px; background: #1c1210; image-rendering: pixelated; image-rendering: crisp-edges; image-rendering: pixelated; }
.gg-msg { margin: 8px 2px 8px; font-size: 13px; line-height: 1.45; color: var(--cocoa-soft); min-height: 2.9em; }
.gg-take { width: 100%; }
.gg-take[hidden] { display: none; }
body.touch .gg-pop { width: min(320px, calc(100vw - 20px)); }
body.touch .gg-pop.docked { top: 70px !important; right: 10px; width: min(230px, calc(100vw - 20px)); }
body.ui-hidden .gg-pop, body.tree-mode .gg-pop { display: none; }
.ml-pop.docked { top: 330px !important; }                       /* 군고구마 창과 겹치지 않게 아래쪽 */
body.touch .ml-pop.docked { top: 290px !important; }

/* 산타 우체통 */
.post-icon { font-size: 64px; line-height: 1; text-align: center; margin: 4px 0 6px; }
#postCard h2 { text-align: center; margin: 0 0 8px; }
#postCard .form-note { text-align: center; margin-bottom: 14px; }

/* 배경음악 버튼 · 설정 */
.music-btn .mute-x { display: none; }
.music-btn.off { opacity: 0.72; }
.music-btn.off .mute-x { display: block; }
.form .snd-check { display: flex; align-items: center; gap: 10px; padding: 8px 0 4px; font-size: 15px; color: var(--cocoa); cursor: pointer; line-height: 1.35; }
.form .snd-check input[type="checkbox"] { flex: none; width: 22px; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 6px; background: none; box-shadow: none; accent-color: var(--red); }
.form .snd-vol { display: flex; align-items: center; gap: 8px; padding: 2px 0 6px 32px; font-size: 15px; }
.form .snd-vol input[type="range"] { flex: 1; min-width: 0; width: auto; height: 26px; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; accent-color: var(--red); }

/* 공유 링크 버튼 · 입장 화면 공유 안내 */
.btn.ghost { background: transparent; color: var(--cocoa-soft); box-shadow: none; font-size: 15px; padding: 8px 12px; }
.btn.ghost::before { display: none; }
.btn.ghost:hover { color: var(--cocoa); filter: none; }
.sheet.card .btn.share-btn, .done-panel .btn.share-btn, #snowDone .btn.share-btn { margin-top: 14px; font-size: 15.5px; padding: 12px 14px 10px; }
.sheet.card .btn.ghost, .done-panel .btn.ghost, #snowDone .btn.ghost { margin-top: 2px; }
.welcome-share { margin: 4px 0 12px; padding: 10px 12px; border-radius: 14px; background: #fde9e2; color: var(--red-deep); font-family: var(--font-display); font-size: 15.5px; text-align: center; line-height: 1.4; }
.welcome-share[hidden] { display: none; }

/* 우체통 후원 수단 */
.post-card { width: min(400px, 100%); }
.post-methods { display: grid; gap: 10px; }
.post-methods .btn { margin-top: 0 !important; display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.toss { background: linear-gradient(180deg, #3d8bff, #0064ff); color: #fff; box-shadow: 0 5px 0 #0048b8, 0 12px 24px rgba(0, 60, 160, 0.3); }
.btn.toss:active { transform: translateY(4px); box-shadow: 0 1px 0 #0048b8; }
.btn.kakao { background: linear-gradient(180deg, #ffeb3b, #fee500); color: #191600; box-shadow: 0 5px 0 #c9b400, 0 12px 24px rgba(120, 100, 0, 0.25); }
.btn.kakao:active { transform: translateY(4px); box-shadow: 0 1px 0 #c9b400; }
.post-account { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: #f7ead0; text-align: left; }
.post-account b { display: block; font-family: var(--font-display); font-weight: normal; font-size: 12.5px; color: var(--cocoa-soft); }
.post-account span { font-size: 15px; color: var(--cocoa); word-break: keep-all; overflow-wrap: anywhere; user-select: all; }
.post-account button { border: 0; border-radius: 10px; padding: 8px 12px; background: var(--pine); color: var(--cream); font-family: var(--font-display); font-size: 14px; cursor: pointer; white-space: nowrap; }
.post-qr { margin-top: 14px; display: grid; justify-items: center; gap: 4px; }
.post-qr[hidden] { display: none; }
.post-qr-img svg { display: block; border-radius: 10px; box-shadow: 0 2px 0 #e9d7b4; }
#postCard .post-qr .form-note { margin: 4px 0 0; font-size: 13px; }
.post-qr-tabs { display: flex; gap: 6px; }
.post-qr-tabs button { border: 0; border-radius: 999px; padding: 4px 10px; background: #f1e1c2; color: var(--cocoa-soft); font-family: var(--font-display); font-size: 13px; cursor: pointer; }
.post-qr-tabs button.on { background: var(--cocoa); color: var(--cream); }
.post-fine { margin: 14px 0 0; font-size: 12.5px; color: var(--cocoa-soft); text-align: center; }

/* 내 오너먼트 · 내 선물 카드: 방금 단/놓은 표시 + 링크 칸 */
.mine-title { margin: -6px 0 6px; font-family: var(--font-display); font-size: 21px; color: var(--red); animation: pop-in .45s cubic-bezier(.2, 1.4, .4, 1); }
.mine-title[hidden] { display: none; }
.share-box { margin-top: 14px; padding: 10px 12px 12px; border-radius: 14px; background: #f7ead0; text-align: left; }
.share-box[hidden] { display: none; }
.share-label { margin: 0 0 6px; font-size: 13px; color: var(--cocoa-soft); text-align: center; }
.share-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.share-row input { min-width: 0; width: 100%; padding: 9px 10px; border: 2px solid #ead7b0; border-radius: 10px; background: #fffdf8; color: var(--cocoa); font: 13.5px/1.2 ui-monospace, Menlo, monospace; }
.share-row button { border: 0; border-radius: 10px; padding: 0 14px; background: var(--red); color: var(--cream); font-family: var(--font-display); font-size: 15px; cursor: pointer; box-shadow: 0 3px 0 var(--red-deep); }
.share-row button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--red-deep); }
.share-note { margin: 6px 0 0; font-size: 12px; color: var(--cocoa-soft); text-align: center; }
.share-note[hidden] { display: none; }
.sheet.card .btn.share-btn[hidden] { display: none; }

/* 공지 · 광고 자리 */
.notice { margin: 8px auto 0; max-width: 424px; padding: 7px 12px; border-radius: 12px; background: rgba(255, 247, 232, 0.92); color: var(--red-deep); font-family: var(--font-display); font-size: 14px; text-align: center; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2); pointer-events: auto; }
.notice[hidden] { display: none; }
.welcome-notice { margin: -2px 0 10px; padding: 8px 12px; border-radius: 12px; background: #fff3cf; color: var(--cocoa); font-size: 14.5px; }
.welcome-notice[hidden] { display: none; }
.ad-slot { position: relative; display: block; margin: 8px auto 0; max-width: 320px; border-radius: 10px; overflow: hidden; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25); pointer-events: auto; background: #fff; }
.ad-slot[hidden] { display: none; }
.ad-slot img { display: block; width: 100%; max-height: 64px; object-fit: cover; }
.ad-tag { position: absolute; right: 4px; top: 3px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 10px; }
body.ui-hidden .notice, body.ui-hidden .ad-slot { display: none; }

/* 나도 걸기 · 코코아 · 신고 */
.sheet.card .btn.join-btn { margin-top: 12px; font-size: 18px; padding: 15px 14px 13px; }
.sheet.card .btn.join-btn[hidden] { display: none; }
.cocoa-btn { display: block; width: 100%; margin-top: 12px; padding: 10px 12px; border: 2px dashed #e6c99a; border-radius: 14px; background: #fff8ea; color: var(--cocoa); font-family: var(--font-display); font-size: 15.5px; cursor: pointer; line-height: 1.25; }
.cocoa-btn small { display: block; font-family: var(--font-body); font-size: 12px; color: var(--cocoa-soft); }
.cocoa-btn[hidden] { display: none; }
.form .cocoa-btn { margin: 4px 0 6px; }
.report-link { display: block; margin: 12px auto 0; font-size: 12.5px; color: var(--cocoa-soft); opacity: 0.8; }
.report-link[hidden] { display: none; }
.report-box { margin-top: 12px; padding: 10px; border-radius: 14px; background: #f7ead0; }
.report-box[hidden] { display: none; }
.report-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.report-reasons button { border: 0; border-radius: 10px; padding: 9px 6px; background: #fffdf8; color: var(--cocoa); font-family: var(--font-display); font-size: 14px; cursor: pointer; box-shadow: 0 2px 0 #e6d3ad; }
.post-sub { margin: -4px 0 6px; text-align: center; font-size: 13px; color: var(--cocoa-soft); }
.ts-box { position: fixed; left: 50%; bottom: calc(18px + var(--safe-bottom)); transform: translateX(-50%); z-index: 80; }
.ts-box:empty { display: none; }
.marker.fw { width: 30px; height: 30px; font-size: 16px; line-height: 1; filter: grayscale(0.8); }
.marker.fw.on { --m: #ff8ad8; filter: none; background: #fff0fa; }
