:root {
  --font-display: 'Jua', sans-serif;
  --font-body: 'Gowun Dodum', system-ui, sans-serif;
  --ink: #fbf5ee;
  --muted: #ddd4e6;
  --night: #2a2645;
  --glass: rgba(36, 30, 56, 0.78); /* 낮의 밝은 눈 위에서도 글자 대비 4.5:1 이상 */
  --red: #b45a40;  /* 흰 글자 대비 4.69:1 */
  --gold: #f2c38b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-user-select: none;
  user-select: none;
}

#app, #app canvas { position: fixed; inset: 0; display: block; }
#app canvas { touch-action: none; }
#app .labels { position: fixed !important; inset: 0; pointer-events: none; }

.label {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(36, 30, 56, 0.78);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  transform: translateY(-4px);
}
.label.me { background: #a9503a; }

#hud, #help, #status {
  position: fixed;
  z-index: 5;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(6px);
  font-size: 14px;
}
#hud {
  top: 16px; left: 16px; display: flex; align-items: center;
  border: 0; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}
#hud .caret { margin-left: 6px; font-size: 11px; color: var(--muted); }

#channelMenu {
  position: fixed;
  top: 58px;
  left: 16px;
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 8px;
  border-radius: 16px;
  background: rgba(36, 30, 56, 0.86);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
#channelMenu button {
  display: flex;
  justify-content: space-between;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
#channelMenu button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
#channelMenu button.current { background: rgba(242, 195, 139, 0.18); }
#channelMenu button:disabled { opacity: 0.4; cursor: default; }
#channelMenu small { color: var(--muted); }
#channelMenu .invite { justify-content: center; margin-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.08); border-radius: 0 0 10px 10px; color: var(--gold); font-size: 13px; }
#hud .dot {
  width: 8px; height: 8px; margin-right: 6px; border-radius: 50%;
  background: #f2c38b; box-shadow: 0 0 8px #f2c38b;
}
#help { bottom: 16px; left: 16px; max-width: calc(100% - 520px); min-width: 260px; color: var(--muted); line-height: 1.5; border-radius: 16px; }
#status { top: 16px; left: 50%; transform: translateX(-50%); background: rgba(201, 106, 79, 0.9); }
[hidden] { display: none !important; }

#corner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 6;
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(480px, calc(100% - 180px));
}
#sound, #timeBtn, #motionBtn, #wishBtn, #letterBtn, #backBtn, #emoteBtn {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
#sound[aria-pressed='false'] { color: var(--muted); }

/* 쉬기 모드: 화면 위 UI가 천천히 사라짐 */
#hud, #help, #minimap, #corner, #joystick { transition: opacity 2.5s ease; }
body.resting #hud, body.resting #help, body.resting #minimap, body.resting #joystick { opacity: 0; }
body.resting #corner { opacity: 0.35; }

#minimap {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 168px;
  height: 168px;
  border-radius: 50%;
  border: 3px solid rgba(255, 244, 232, 0.8);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

#zone {
  position: fixed;
  top: 18%;
  left: 50%;
  z-index: 4;
  transform: translate(-50%, 8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-shadow: 0 2px 16px rgba(36, 30, 56, 0.85);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.4s ease, transform 1.4s ease;
}
#zone strong { font-family: var(--font-display); font-weight: 400; font-size: 34px; }
#zone { padding: 12px 24px; border-radius: 18px; background: var(--glass); backdrop-filter: blur(6px); }
#zone span { font-size: 15px; color: var(--muted); letter-spacing: 0.04em; }
#zone.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 600px) {
  #minimap { width: 112px; height: 112px; }
  #zone strong { font-size: 26px; }
}

/* ---------- 입장 화면 ---------- */
#intro {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, rgba(42, 38, 69, 0.1), rgba(42, 38, 69, 0.7));
}
.card {
  width: min(360px, 100%);
  padding: 28px 24px 24px;
  border-radius: 20px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
  user-select: auto;
}
.eyebrow { margin: 0; color: var(--gold); letter-spacing: 0.2em; font-size: 12px; text-transform: uppercase; }
h1 { margin: 4px 0 6px; font-family: var(--font-display); font-size: 52px; font-weight: 400; }
.sub { margin: 0 0 22px; color: var(--muted); line-height: 1.5; }

.field { display: block; margin-bottom: 16px; text-align: left; }
.field > span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.field input:focus { border-color: var(--gold); }

.colors { display: flex; justify-content: space-between; gap: 6px; }
.colors button {
  width: 32px; height: 32px; padding: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
}
.colors button[aria-pressed='true'] { border-color: #fff; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3); }

button[type='submit'] {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  cursor: pointer;
}
.hint { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
button[type='submit']:hover { filter: brightness(1.1); }

/* ---------- 모바일 조이스틱 ---------- */
#joystick {
  position: fixed;
  left: 28px;
  bottom: 28px;
  z-index: 6;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  touch-action: none;
}
#stick {
  position: absolute;
  left: 50%; top: 50%;
  width: 52px; height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}

@media (pointer: coarse) {
  #help { display: none !important; }
}

/* ---------- 알림 ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 72px;
  z-index: 12;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(36, 30, 56, 0.8);
  backdrop-filter: blur(6px);
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.5s, transform 0.5s;
  pointer-events: none;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 편지 나무 ---------- */
.prompt {
  position: fixed;
  left: 50%;
  bottom: 64px;
  z-index: 6;
  transform: translateX(-50%);
  padding: 12px 20px;
  border: 1px solid rgba(242, 195, 139, 0.6);
  border-radius: 999px;
  background: rgba(36, 30, 56, 0.72);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  cursor: pointer;
  animation: breathe 3.2s ease-in-out infinite;
}
.prompt kbd {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.15);
  font-family: inherit;
  font-size: 13px;
}
@keyframes breathe { 50% { box-shadow: 0 0 22px rgba(242, 195, 139, 0.45); } }
@media (pointer: coarse) { .prompt kbd { display: none; } }

.panel {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 11;
  display: flex;
  flex-direction: column;
  width: min(440px, calc(100% - 32px));
  max-height: min(640px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(36, 30, 56, 0.82);
  backdrop-filter: blur(12px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
}
.panel header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 20px 10px;
}
.panel h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 28px; }
.panel-count { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.panel-close {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
}
#letterList {
  flex: 1;
  margin: 0;
  padding: 4px 20px 12px;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}
#letterList li {
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border-left: 3px solid var(--c, var(--gold));
  background: rgba(255, 248, 238, 0.07);
}
#letterList p { margin: 0 0 6px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
#letterList .meta { font-size: 13px; color: var(--muted); }

.panel-body {
  padding: 14px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.panel-body .note { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.panel-body .gbtn { display: flex; justify-content: center; min-height: 44px; }
.panel-body textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
  resize: none;
}
.panel-body textarea:focus { border-color: var(--gold); }
.panel-body .row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.panel-body .counter { flex: 1; font-size: 13px; color: var(--muted); }
button.primary {
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.45; cursor: default; }
button.link {
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.letter-bubble {
  max-width: 220px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 248, 238, 0.92);
  color: #3a2f4f;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  box-shadow: 0 6px 24px rgba(36, 30, 56, 0.35);
  opacity: 0;
  transform: translateY(calc(-50% - 6px));
  transition: opacity 1.2s ease, transform 1.2s ease;
}
.letter-bubble.show { opacity: 1; transform: translateY(-50%); }
.letter-bubble p { margin: 0 0 4px; }
.letter-bubble span { font-size: 12px; color: #7a6a86; }

@media (max-width: 600px) {
  .panel { top: auto; bottom: 0; transform: translateX(-50%); border-radius: 20px 20px 0 0; width: 100%; max-height: 75%; }
}

/* 일본어: Jua·Gowun Dodum에는 가나가 없어 둥근 일본어 글꼴로 */
:root:lang(ja) {
  --font-display: 'M PLUS Rounded 1c', sans-serif;
  --font-body: 'M PLUS Rounded 1c', system-ui, sans-serif;
}
:lang(ja) h1, :lang(ja) #zone strong, :lang(ja) .panel h2 { font-weight: 800; }
:lang(ja) h1 { font-size: 44px; }

.langs { display: flex; justify-content: center; gap: 4px; margin-top: 10px; }
.langs button {
  min-height: 36px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.langs button[aria-pressed='true'] { background: rgba(255, 255, 255, 0.1); color: var(--ink); }

/* ---------- 접근성 ---------- */
/* 키보드로 움직일 때 선명한 초점 링 */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.panel:focus, .panel:focus-visible { outline: none; }
.colors button:focus-visible { outline-offset: 3px; }

.panel-body li.removing { opacity: 0.4; }

/* 움직임 줄이기: 기기 설정이나 게임 안 버튼 (html.reduce-motion) */
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
  animation: none !important;
  transition-duration: 0.01ms !important;
}
html.reduce-motion #zone, html.reduce-motion #zone.show,
html.reduce-motion #toast, html.reduce-motion #toast.show,
html.reduce-motion .letter-bubble, html.reduce-motion .letter-bubble.show { transform: translate(-50%, 0); }
html.reduce-motion .letter-bubble, html.reduce-motion .letter-bubble.show { transform: translateY(-50%); }

@media (max-width: 900px) {
  #help { max-width: none; right: 16px; bottom: 112px; min-width: 0; }
}
.panel .goto { margin-top: 6px; }

/* ---------- 캐릭터 고르기 ---------- */
.kinds { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
@media (max-width: 380px) { .kinds { grid-template-columns: repeat(3, 1fr); } }
.kinds button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding: 6px 2px 8px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.kinds button[aria-checked='true'] { border-color: var(--gold); background: rgba(242, 195, 139, 0.14); color: var(--ink); }
.kinds img { width: 100%; max-width: 64px; height: auto; aspect-ratio: 1; }
.kinds span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.card { width: min(400px, 100%); }

#backBtn { border: 1px solid rgba(242, 195, 139, 0.7); color: var(--ink); }
/* 순간이동할 때 잠깐 어두워짐 */
#fade { position: fixed; inset: 0; z-index: 3; background: #1c1830; opacity: 0; pointer-events: none; transition: opacity 0.18s ease; }
#fade.on { opacity: 0.85; }

/* ---------- 편지 나무 패널 ---------- */
.panel-body { flex: 1; overflow-y: auto; padding: 4px 20px 20px; overscroll-behavior: contain; }
.panel-body .note { margin: 0 0 14px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.panel-body h3 { margin: 18px 0 10px; font-size: 15px; font-weight: 700; color: var(--ink); }
.panel-body label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.panel-body input[type='text'], .panel-body textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 12px;
  background: rgba(255, 255, 255, 0.07); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.6;
}
.panel-body textarea { resize: vertical; min-height: 160px; }
.panel-body input:focus, .panel-body textarea:focus { border-color: var(--gold); }
.panel-body .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.panel-body .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.panel-body .counter { flex: 1; font-size: 13px; color: var(--muted); }
.panel-body .gbtn { display: flex; justify-content: center; min-height: 44px; }
.share { margin: 12px 0 4px; padding: 14px; border-radius: 14px; background: rgba(242, 195, 139, 0.12); border: 1px solid rgba(242, 195, 139, 0.4); }
.share p { margin: 0 0 8px; font-size: 14px; }
.share .linkrow { display: flex; gap: 8px; }
.share input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.2); background: rgba(0, 0, 0, 0.2); color: var(--ink); font: inherit; font-size: 13px; }
.share small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
#letterList { list-style: none; margin: 0; padding: 0; }
#letterList li { padding: 12px 14px; margin-bottom: 8px; border-radius: 12px; background: rgba(255, 248, 238, 0.07); }
#letterList .top { display: flex; justify-content: space-between; gap: 8px; }
#letterList .to { font-weight: 700; }
#letterList .status { font-size: 13px; color: var(--gold); white-space: nowrap; }
#letterList .preview { margin: 4px 0 6px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#letterList .actions { display: flex; gap: 14px; }
button.secondary {
  padding: 10px 16px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px;
  background: transparent; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}

/* ---------- 받은 편지 ---------- */
#letterView {
  position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px;
  background: rgba(28, 24, 48, 0.55); backdrop-filter: blur(4px); overflow-y: auto;
}
#letterView:focus { outline: none; }
#letterView .paper {
  width: min(520px, 100%); padding: 32px 28px 28px; border-radius: 18px;
  background: #fff8ee; color: #3a2f4f; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  background-image: repeating-linear-gradient(transparent 0 31px, rgba(201, 106, 79, 0.12) 31px 32px);
  text-align: left; user-select: text; -webkit-user-select: text;
}
#letterView .eyebrow { color: #a9503a; text-align: center; margin-bottom: 18px; }
#letterView .to, #letterView .from { font-family: var(--font-display); font-size: 22px; margin: 0; }
#letterView .from { text-align: right; margin-top: 18px; }
#letterView .body { margin: 16px 0 0; font-size: 17px; line-height: 2; white-space: pre-wrap; overflow-wrap: anywhere; }
#letterView .meta { text-align: right; font-size: 13px; color: #6f6080; margin: 6px 0 0; }
#letterView .primary { display: block; width: 100%; }
/* 봉인된 봉투 */
.envelope { text-align: center; }
.envelope .env {
  position: relative; width: 220px; height: 140px; margin: 8px auto 20px; border-radius: 12px;
  background: #e9c9a0; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}
.envelope .env::before {
  content: ''; position: absolute; inset: 0; border-radius: 12px;
  background: linear-gradient(to bottom right, transparent 49.5%, #dcb88c 50%) left / 50% 100% no-repeat,
              linear-gradient(to bottom left, transparent 49.5%, #dcb88c 50%) right / 50% 100% no-repeat;
}
.envelope .flap { position: absolute; left: 0; right: 0; top: 0; height: 80px; background: #f0d5b0; clip-path: polygon(0 0, 100% 0, 50% 100%); border-radius: 12px 12px 0 0; }
.envelope .seal {
  position: absolute; left: 50%; top: 58px; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%;
  background: #b5403a; color: #fff3e6; display: grid; place-items: center; font-size: 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.envelope h2 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 400; font-size: 26px; }
.envelope .names { margin: 0 0 14px; font-size: 16px; }
.envelope .dday { display: inline-block; margin: 4px 0 10px; padding: 6px 16px; border-radius: 999px; background: #b5403a; color: #fff; font-family: var(--font-display); font-size: 20px; }
.envelope .private { font-size: 13px; color: #6f6080; margin: 8px 0 0; }
:lang(ja) .envelope h2, :lang(ja) #letterView .to, :lang(ja) #letterView .from { font-weight: 800; }

/* ---------- 소원 목록 ---------- */
#wishList { list-style: none; margin: 0 0 12px; padding: 0; }
#wishList li { margin-bottom: 10px; padding: 12px 14px; border-radius: 12px; border-left: 3px solid var(--c, var(--gold)); background: rgba(255, 248, 238, 0.07); }
#wishList p { margin: 0 0 6px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
#wishList .meta { font-size: 13px; color: var(--muted); }
#wishBody textarea { min-height: 84px; }
#wishBody .composer { position: sticky; bottom: -20px; padding: 12px 0 4px; background: linear-gradient(transparent, rgba(36, 30, 56, 0.95) 20%); }

/* ---------- 이모지 말풍선 ---------- */
#emoteBtn { font-size: 20px; padding: 4px 12px; }
#emoteMenu {
  position: fixed; right: 16px; bottom: 112px; z-index: 9;
  display: grid; grid-template-columns: repeat(4, 48px); gap: 6px; padding: 10px;
  border-radius: 18px; background: rgba(36, 30, 56, 0.86); backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
#emoteMenu button {
  width: 48px; height: 48px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, 0.08);
  font-size: 26px; line-height: 1; cursor: pointer;
}
#emoteMenu button:hover, #emoteMenu button:focus-visible { background: rgba(242, 195, 139, 0.25); }
.emote-bubble {
  position: relative;
  padding: 6px 10px; border-radius: 18px; background: rgba(255, 252, 247, 0.95);
  box-shadow: 0 4px 14px rgba(36, 30, 56, 0.25);
  font-size: 30px; line-height: 1;
  opacity: 0; transform: translateY(6px) scale(0.6);
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
  pointer-events: none;
}
.emote-bubble::after { /* 말풍선 꼬리 */
  content: ''; position: absolute; left: 50%; bottom: -6px; margin-left: -6px;
  border: 6px solid transparent; border-bottom: 0; border-top-color: rgba(255, 252, 247, 0.95);
}
.emote-bubble.show { opacity: 1; transform: translateY(0) scale(1); }
.emote-bubble.still { transition: opacity 0.2s; transform: none; }

.hint a, .panel-body .note a { color: var(--muted); }

/* 받은 편지 아래 버튼 둘, 입장 화면 안내 */
#letterView .view-actions { display: flex; gap: 10px; margin-top: 24px; }
#letterView .view-actions button { flex: 1; margin-top: 0; }
#letterView .view-actions .secondary { color: #3a2f4f; border-color: rgba(58, 47, 79, 0.35); }
.intro-note { margin: -10px 0 18px; padding: 10px 12px; border-radius: 12px; background: rgba(242, 195, 139, 0.16); color: var(--ink); font-size: 14px; line-height: 1.5; }
