/* 안녕 단지 이야기: 주민 화면의 해 질 녘 옛 아파트 단지(2026-10-17 사용자 지시 "귀여운 캐릭터와 삽화, 애니메이티드한 과정으로 대화하며 진행.
   감성 플레이", "네온 'open' 간판 같은 '안녕'", "차갑지 않게 따뜻한 감성으로").
   첫 화면(index.html)·참여(p/)가 쓴다. 해설(m/)은 머리의 [단지로] 단추만 이 세계를 빌린다(m.css).
   읽는 순서: lm-tokens.css → fonts/pretendard/…dynamic-subset.css → base.css → story.css
   색은 lm-tokens.css의 --st- 토큰만 쓴다(이 파일에 hex 없음). 글은 Pretendard, 본문 20px 이상, 누르는 자리 56px 이상.
   움직임은 느리고 작게(불 켜짐·말풍선·종이 붙기·네온 켜짐). 움직임 줄이기면 base.css와 아래 규칙이 모두 멈춘 채 다 보이게 한다. */

/* ── 바탕 ── */

body.st {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--st-bg);
  color: var(--st-ink);
  font-size: calc(var(--rd-fs-body) + 2px);
  line-height: 1.6;
  caret-color: var(--st-accent);
  accent-color: var(--st-accent);
}

body.st ::selection {
  background: var(--st-accent);
  color: var(--st-accent-ink);
}

body.st :where(h1, h2, h3, strong) {
  color: inherit;
}

body.st :where(a, button, input, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--st-accent);
  outline-offset: 3px;
}

.st-main {
  flex: 1 0 auto;
  width: 100%;
}

/* ── 위 막대: [‹ 단지로] · 작은 네온 '안녕' · (예시·건너뛰기) ── */

.st-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: min(100%, 1120px);
  min-height: 64px;
  margin: 0 auto;
  padding: 8px 16px 0;
  animation: st-fade 400ms var(--lm-ease-out) both;
}

.st-top-start {
  display: flex;
  justify-content: flex-start;
}

.st-back {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  min-height: 48px;
  padding: 0 18px 0 12px;
  border: 1px solid var(--st-card-line);
  border-radius: var(--lm-radius-pill);
  background: var(--st-card);
  color: var(--st-ink);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--lm-duration-fast) var(--lm-ease-out);
}

.st-back .icon {
  width: 20px;
  height: 20px;
}

.st-back:hover {
  border-color: var(--st-accent);
}

.st-mark {
  display: block;
  border-radius: 12px;
}

/* 글자 크기 단추 하나: '가'와 지금 크기를 보이는 점 셋 */
.st-font {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 56px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--st-card-line);
  border-radius: var(--lm-radius-pill);
  background: var(--st-card);
  color: var(--st-ink);
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.st-font:hover {
  border-color: var(--st-accent);
}

.st-font-dots {
  display: grid;
  gap: 3px;
}

.st-font-dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--st-card-line);
}

/* 점은 아래에서 위로 찬다(보통 하나, 크게 둘, 아주 크게 셋) */
.st-font-dots i:nth-child(3),
.st-font[data-size="l"] .st-font-dots i:nth-child(2),
.st-font[data-size="xl"] .st-font-dots i {
  background: var(--st-accent);
}

.st-mark .nw {
  display: block;
  width: auto;
  height: 40px;
}

.st-top-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.st-chip {
  padding: 4px 12px;
  border: 1px solid var(--st-accent);
  border-radius: var(--lm-radius-pill);
  color: var(--st-accent);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.st-skip {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--st-card-line);
  border-radius: var(--lm-radius-pill);
  background: transparent;
  color: var(--st-ink);
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.st-skip:hover {
  border-color: var(--st-accent);
}

/* 첫 화면에서는 위 막대 대신 큰 네온이 이름표다 */
body.is-title .st-top {
  display: none;
}

/* ── 바닥 ── */

.st-foot {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 12px 16px calc(16px + var(--lm-safe-bottom));
  color: var(--st-ink-muted);
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
}

.st-legal {
  color: var(--st-ink);
  font-size: 17px;
  font-weight: 600;
}

.st-foot ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.st-foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--st-ink-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.st-foot a:hover {
  color: var(--st-accent);
}

.st-foot .brand-logo {
  height: 12px;
  opacity: 0.75;
}

/* ── 큰 단추(첫 화면 [시작]) ── */

.st-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  min-height: 64px;
  padding: 0 40px;
  border: 1.5px solid var(--st-card-line);
  border-radius: var(--lm-radius-pill);
  background: var(--st-card);
  color: var(--st-ink);
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform var(--lm-duration-fast) var(--lm-ease-out), background-color var(--lm-duration-fast) var(--lm-ease-out);
}

.st-btn.is-primary {
  border-color: var(--st-accent);
  background: var(--st-accent);
  color: var(--st-accent-ink);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--st-accent) 32%, transparent);
}

.st-btn:hover {
  transform: translateY(-1px);
}

.st-btn:active {
  transform: translateY(1px);
}

/* ── 글상자(story/dialog.js): 얼굴·이름 · 한 문장 · 큰 단추 ── */

.sd {
  position: relative;
  width: min(calc(100% - 24px), 560px);
  margin: 0 auto;
  padding: 16px 18px 18px;
  border: 1px solid var(--st-card-line);
  border-radius: 24px;
  background: var(--st-card);
  box-shadow: 0 18px 40px color-mix(in srgb, var(--st-line) 70%, transparent);
  color: var(--st-ink);
  animation: st-rise 360ms var(--lm-ease-out) both;
}

.sd[hidden] {
  display: none;
}

.sd:focus {
  outline: none;
}

.sd-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.sd-face {
  flex: none;
  width: 60px;
  height: 60px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--st-card-raised);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--st-accent) 60%, transparent);
}

.sd-face[hidden] {
  display: none;
}

.pp-face {
  display: block;
  width: 100%;
  height: 100%;
}

.sd-name {
  margin: 0;
  color: var(--st-accent);
  font-size: 17px;
  font-weight: 800;
}

.sd-count {
  margin: 0 0 0 auto;
  color: var(--st-ink-muted);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sd-text {
  min-height: 1.5em;
  margin: 0;
  font-size: calc(var(--rd-fs-body) + 4px);
  font-weight: 650;
  line-height: 1.5;
  white-space: pre-line;
  word-break: keep-all;
  overflow-wrap: anywhere;
  cursor: default;
}

/* 글이 나오는 동안 끝에 깜빡이는 막대 하나 */
.sd.is-typing .sd-text::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  background: var(--st-accent);
  vertical-align: -0.12em;
  animation: st-caret 0.9s steps(1) infinite;
}

.sd-extra:empty,
.sd-choices:empty {
  display: none;
}

.sd-extra {
  margin-top: 14px;
}

.sd-choices {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.sd-choices.is-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sd-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 60px;
  margin: 0;
  padding: 10px 14px;
  border: 1.5px solid var(--st-card-line);
  border-radius: 16px;
  background: var(--st-card-raised);
  color: var(--st-ink);
  font: inherit;
  font-size: var(--rd-fs-control);
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  animation: st-rise 280ms var(--lm-ease-out) both;
  transition: border-color var(--lm-duration-fast) var(--lm-ease-out), background-color var(--lm-duration-fast) var(--lm-ease-out), transform var(--lm-duration-fast) var(--lm-ease-out);
}

.sd-choice:nth-child(2) { animation-delay: 40ms; }
.sd-choice:nth-child(3) { animation-delay: 80ms; }
.sd-choice:nth-child(4) { animation-delay: 120ms; }
.sd-choice:nth-child(n + 5) { animation-delay: 160ms; }

.sd-choice:hover {
  border-color: var(--st-accent);
}

.sd-choice:active {
  transform: translateY(1px);
}

.sd-choice.is-primary {
  border-color: var(--st-accent);
  background: var(--st-accent);
  color: var(--st-accent-ink);
}

.sd-choice.is-apart {
  grid-column: 1 / -1;
  min-height: 56px;
  border-style: dashed;
  background: transparent;
  color: var(--st-ink-muted);
  font-size: 18px;
}

.sd-choice:disabled {
  cursor: default;
  opacity: 0.55;
}

.sd-choice.is-picked {
  opacity: 1;
  border-color: var(--st-accent);
}

.sd-choice-note {
  padding: 2px 10px;
  border-radius: var(--lm-radius-pill);
  background: color-mix(in srgb, var(--st-accent) 24%, var(--st-card-raised));
  color: var(--st-ink);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.sd-choice.is-primary .sd-choice-note {
  background: color-mix(in srgb, var(--st-accent-ink) 14%, var(--st-accent));
  color: var(--st-accent-ink);
}

/* 글상자 안의 글자 칸(참여권 글자로 들어가기) */
.sd-field {
  display: grid;
  gap: 8px;
}

.sd-field label {
  color: var(--st-ink-muted);
  font-size: 17px;
  font-weight: 700;
}

.sd-input {
  width: 100%;
  min-height: 56px;
  padding: 8px 14px;
  border: 1.5px solid var(--st-card-line);
  border-radius: 14px;
  background: var(--st-bg);
  color: var(--st-ink);
  font: inherit;
  font-size: 22px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sd-input:focus-visible {
  border-color: var(--st-accent);
  outline: 3px solid color-mix(in srgb, var(--st-accent) 45%, transparent);
  outline-offset: 2px;
}

/* ── 네온 '안녕'(story/neon.js) ── */

.nw {
  display: block;
  overflow: visible;
}

.nw-tube-off,
.nw-glow,
.nw-tube,
.nw-core {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nw-tube-off { stroke: var(--st-neon-off); stroke-width: 7; }
.nw-glow { stroke-width: 14; opacity: 0.85; }
.nw-tube { stroke-width: 6.5; }
.nw-core { stroke: var(--st-neon-core); stroke-width: 2; opacity: 0.85; }

.nw-stop-violet { stop-color: var(--st-neon-violet); }
.nw-stop-pink { stop-color: var(--st-neon-pink); }
.nw-stop-coral { stop-color: var(--st-neon-coral); }
.nw-stop-orange { stop-color: var(--st-neon-orange); }
.nw-stop-yellow { stop-color: var(--st-neon-yellow); }
.nw-stop-green { stop-color: var(--st-neon-green); }
.nw-stop-sky { stop-color: var(--st-neon-sky); }

/* 켜짐: 획마다 차례로 깜빡이며 들어와 그대로 켜져 있다 */
.nw.is-lit .nw-seg {
  animation: nw-on 1.3s linear both;
}

.nw.is-lit .nw-seg:nth-child(2) { animation-delay: 0.12s; }
.nw.is-lit .nw-seg:nth-child(3) { animation-delay: 0.2s; }
.nw.is-lit .nw-seg:nth-child(4) { animation-delay: 0.32s; }
.nw.is-lit .nw-seg:nth-child(5) { animation-delay: 0.55s; }
.nw.is-lit .nw-seg:nth-child(6) { animation-delay: 0.64s; }
.nw.is-lit .nw-seg:nth-child(7) { animation-delay: 0.7s; }
.nw.is-lit .nw-seg:nth-child(8) { animation-delay: 0.76s; }
.nw.is-lit .nw-seg:nth-child(9) { animation-delay: 0.9s; }

@keyframes nw-on {
  0% { opacity: 0; }
  10% { opacity: 1; }
  16% { opacity: 0.2; }
  24% { opacity: 1; }
  30% { opacity: 0.55; }
  38%, 100% { opacity: 1; }
}

/* 위 막대의 작은 네온은 처음부터 켜져 있다 */
.st-mark .nw.is-lit .nw-seg {
  animation: none;
}

/* ── 단지(첫 화면·이야기·고르기) ── */

.st-danji .st-main {
  display: grid;
  align-content: center;
}

.dj {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 0 0 8px;
}

.dj-sign {
  --sign-w: min(72vw, 400px);
  position: relative;
  z-index: 2;
  width: var(--sign-w);
  /* 아래쪽 약 3분의 1이 단지 그림의 하늘에 겹친다 */
  margin: 28px auto calc(var(--sign-w) * -0.3);
}

.dj-sign .nw {
  width: 100%;
  height: auto;
}

body:not(.is-title) .dj-sign,
body:not(.is-title) .dj-start {
  display: none;
}

.dj-stage {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 410 / 415;
  overflow: hidden;
}

/* 이야기·고르기 때는 하늘 위쪽을 조금 잘라 글상자 자리를 낸다(그림은 아래에 붙인다). 휴대전화는 조금 더 자른다 */
body:not(.is-title) .dj-stage {
  aspect-ratio: 410 / 360;
}

@media (max-width: 479px) {
  body:not(.is-title) .dj-stage {
    aspect-ratio: 410 / 330;
  }

  /* 3D 단지는 휴대전화에서 정사각으로 넉넉하게 */
  body:not(.is-title) .dj-stage.is-orbit {
    aspect-ratio: 1 / 1;
  }
}

/* 공지 종이: 게시판 쪽으로 다가간 그림 위에 크게 떨어져 붙는다(장식, 글상자가 같은 것을 말한다) */
.dj-paper {
  position: absolute;
  top: 18%;
  left: 50%;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: 42%;
  padding: 18px 16px 16px;
  border-radius: 6px;
  background: var(--st-paper);
  color: var(--st-accent-ink);
  box-shadow: 0 14px 30px color-mix(in srgb, var(--st-line) 60%, transparent);
  translate: -50% 0;
  rotate: -2deg;
  animation: dj-drop 620ms var(--lm-ease-out) both;
}

.dj-paper-pin {
  position: absolute;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--st-neon-coral);
  translate: -50% 0;
}

.dj-paper-title {
  margin: 0 0 2px;
  font-size: 19px;
  font-weight: 800;
  text-align: center;
}

.dj-paper-line {
  display: block;
  height: 6px;
  border-radius: var(--lm-radius-pill);
  background: color-mix(in srgb, var(--st-wall-r) 35%, var(--st-paper));
}

.dj-paper-line.is-short {
  width: 64%;
}

@keyframes dj-drop {
  from { opacity: 0; translate: -50% -24px; rotate: -6deg; }
}

/* 옆집 이웃이 길에서 게시판 앞으로 걸어간다 */
.dg-walker {
  transform: translate(-30px, 14px);
  transition: transform 1600ms var(--lm-ease-out);
}

.dg-walker.is-arrived {
  transform: none;
}

.dj-inner {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  aspect-ratio: 410 / 415;
}

.dj-inner {
  transition: transform 900ms var(--lm-ease-out);
  transform-origin: var(--x, 50%) var(--y, 50%);
}

.dj-stage.is-zoom > .dj-inner {
  transform: scale(2.4);
}

.dg {
  display: block;
  width: 100%;
  height: 100%;
}

.dj-over {
  position: absolute;
  inset: 0;
}

.dj-start {
  margin-top: -8px;
}

/* 말풍선(이웃들의 걱정·바람). 그림 위 창 자리에 붙는다 */
.dj-bubble {
  position: absolute;
  left: var(--x);
  top: var(--y);
  max-width: 46%;
  margin: 0;
  padding: 6px 12px;
  border-radius: 14px;
  background: var(--st-paper);
  color: var(--st-accent-ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  translate: -50% -100%;
  transform-origin: 50% 100%;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--st-line) 55%, transparent);
  animation: st-pop 420ms var(--lm-ease-out) both;
  pointer-events: none;
}

.dj-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  border: 6px solid transparent;
  border-bottom: 0;
  border-top-color: inherit;
  translate: -50% 0;
}

.dj-bubble { border-top-color: var(--st-paper); }
.dj-bubble.is-worry { background: var(--st-win-peach); border-top-color: var(--st-win-peach); }
.dj-bubble.is-wish { background: var(--st-cloth-b); border-top-color: var(--st-cloth-b); }
.dj-bubble.is-mine { background: var(--st-accent); border-top-color: var(--st-accent); }

/* 게시판에 공지가 붙었다는 둥근 물결 */
.dj-ping {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 36px;
  height: 36px;
  border: 2px solid var(--st-accent);
  border-radius: 50%;
  translate: -50% -20%;
  animation: st-ping 1.8s var(--lm-ease-out) infinite;
  pointer-events: none;
}

/* 그림 위 곳 단추(고르기 때만) */
.dj-spot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 12px;
  border: 1.5px solid var(--st-accent);
  border-radius: var(--lm-radius-pill);
  background: color-mix(in srgb, var(--st-card) 92%, transparent);
  color: var(--st-ink);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  translate: -50% -100%;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color var(--lm-duration-fast) var(--lm-ease-out), color var(--lm-duration-fast) var(--lm-ease-out);
}

/* 손가락이 닿는 자리는 보이는 단추보다 넓게(44px 이상) */
.dj-spot::before {
  content: "";
  position: absolute;
  inset: -6px -4px;
}

body.is-hub .dj-spot:not([hidden]) {
  display: inline-flex;
  animation: st-pop 360ms var(--lm-ease-out) both;
}

.dj-spot:hover,
.dj-spot[aria-current="true"] {
  background: var(--st-accent);
  color: var(--st-accent-ink);
}

.dj-spot-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--st-accent);
}

.dj-spot:hover .dj-spot-dot,
.dj-spot[aria-current="true"] .dj-spot-dot {
  background: var(--st-accent-ink);
}

.dj-dialog {
  align-self: start;
}

/* 넓은 화면: 단지 그림 왼쪽, 글상자 오른쪽 */
@media (min-width: 980px) {
  body:not(.is-title) .dj {
    grid-template-columns: minmax(0, 600px) 440px;
    grid-template-areas: "stage dialog" "caption dialog";
    align-items: center;
    justify-content: center;
    gap: 8px 40px;
    padding: 8px 24px 16px;
  }

  body:not(.is-title) .dj-stage { grid-area: stage; }
  body:not(.is-title) .dj-caption { grid-area: caption; margin: 0; }
  body:not(.is-title) .dj-dialog { grid-area: dialog; }

  body:not(.is-title) .dj-stage {
    width: min(100%, 600px);
    max-height: calc(100dvh - 150px);
  }

  .dj-dialog {
    width: 440px;
    align-self: center;
  }

  .dj-sign {
    --sign-w: min(40vw, 400px);
  }

  .dj-stage {
    width: min(100%, 600px);
  }
}

/* 첫 화면이 짧은 넓은 창(1280×800)에서도 [시작]이 첫 화면 안에 든다 */
@media (min-width: 980px) and (max-height: 900px) {
  body.is-title .dj-stage {
    width: min(100%, 470px);
  }

  body.is-title .dj-sign {
    --sign-w: 330px;
    margin-top: 8px;
  }
}

/* ── 단지 그림(story/diorama.js) ── */

.dg-dusk { fill: var(--st-sky-glow); opacity: 0.6; }
.dg-moon { fill: var(--st-win-honey); }
.dg-moon-cut { fill: var(--st-bg); }
.dg-star { fill: var(--st-ink); opacity: 0.5; }

.dg-ground { fill: var(--st-ground); }
.dg-ground-l { fill: var(--st-ground-side); }
.dg-ground-r { fill: var(--st-ground-deep); }
.dg-grass { fill: var(--st-grass); }
.dg-path { fill: var(--st-path); }
.dg-sand { fill: var(--st-sand); }

.dg-wall-l { fill: var(--st-wall-l); }
.dg-wall-r { fill: var(--st-wall-r); }
.dg-wall-t { fill: var(--st-roof); }
.dg-parapet-l { fill: var(--st-trim); }
.dg-parapet-r { fill: var(--st-wall-l); }
.dg-band { stroke: var(--st-wall-r); stroke-width: 1; }

.dg-win { fill: var(--st-win-off); transition: fill 700ms var(--lm-ease-out); }
.dg-win.is-on.tint-0 { fill: var(--st-win-on); }
.dg-win.is-on.tint-1 { fill: var(--st-win-honey); }
.dg-win.is-on.tint-2 { fill: var(--st-win-peach); }
body.is-hub .dg-home { stroke: var(--st-neon-pink); stroke-width: 1.6; }
.dg.is-home .dg-home { stroke-width: 2.6; }

.dg-rope { stroke: var(--st-ink-muted); stroke-width: 0.6; opacity: 0.7; }
.dg-cloth-a { fill: var(--st-cloth-a); }
.dg-cloth-b { fill: var(--st-cloth-b); }
.dg-cloth-c { fill: var(--st-cloth-c); }

.dg-shade { fill: var(--st-line); opacity: 0.35; }
.dg-trunk { fill: var(--st-trunk); }
.dg-leaf { fill: var(--st-tree); }
.dg-leaf-light { fill: var(--st-tree-light); }

.dg-lamp-glow { fill: var(--st-lamp); opacity: 0.4; }
.dg-post { stroke: var(--st-line); stroke-width: 1.6; fill: var(--st-line); }
.dg-bulb { fill: var(--st-lamp); }

.dg-wood-l, .dg-wood-t { fill: var(--st-wood); }
.dg-wood-r { fill: var(--st-trunk); }
.dg-leg { stroke: var(--st-line); stroke-width: 1.2; }

.dg-cat-body { fill: var(--st-cat); }
.dg-cat-tail { fill: none; stroke: var(--st-cat); stroke-width: 1.8; stroke-linecap: round; }

.dg-wire { fill: none; stroke: var(--st-line); stroke-width: 0.8; }
.dg-bead-0 { fill: var(--st-win-honey); }
.dg-bead-1 { fill: var(--st-neon-pink); }
.dg-bead-2 { fill: var(--st-neon-yellow); }

.dg-slide-l, .dg-slide-t { fill: var(--st-knit); }
.dg-slide-r { fill: var(--st-cloth-a); }
.dg-ramp { fill: var(--st-neon-yellow); opacity: 0.85; }
.dg-swing-post { stroke: var(--st-trim); stroke-width: 1.4; stroke-linecap: round; }
.dg-seat { stroke: var(--st-wood); stroke-width: 1.8; stroke-linecap: round; }

.dg-boardbox-l { fill: var(--st-wood); }
.dg-boardbox-r { fill: var(--st-trunk); }
.dg-boardbox-t { fill: var(--st-wood); }
.dg-notice { fill: var(--st-paper); }
.dg-notice-title { stroke: var(--st-neon-coral); stroke-width: 1.4; }
.dg-notice-line { stroke: var(--st-wall-r); stroke-width: 0.8; }
.dg-old-paper { fill: var(--st-paper); opacity: 0.5; }
.dg-paper {
  opacity: 0;
  transform: scale(0.2);
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transition: transform 640ms var(--lm-ease-out), opacity 260ms var(--lm-ease-out);
}
.dg-paper.is-up { opacity: 1; transform: none; }

.dg-shop-l { fill: var(--st-wall-l); }
.dg-shop-r { fill: var(--st-wall-r); }
.dg-shop-t { fill: var(--st-roof); }
.dg-shopwin { fill: var(--st-win-honey); }
.dg-awning-l, .dg-awning-t { fill: var(--st-knit); }
.dg-awning-r { fill: var(--st-cloth-a); }
.dg-neon { stroke: var(--st-neon-pink); stroke-width: 1.6; stroke-linecap: round; }
.dg-neon-glow { stroke: var(--st-neon-pink); stroke-width: 5; stroke-linecap: round; opacity: 0.8; }
.dg-sign-l { fill: var(--st-neon-yellow); }
.dg-sign-r, .dg-sign-t { fill: var(--st-neon-orange); }

.dg-booth-l { fill: var(--st-trim); }
.dg-booth-r { fill: var(--st-wall-l); }
.dg-booth-t, .dg-roofcap-t { fill: var(--st-roof); }
.dg-roofcap-l, .dg-roofcap-r { fill: var(--st-wall-r); }
.dg-boothwin { fill: var(--st-win-on); }

.dg-wallet-l { fill: var(--st-trim); }
.dg-wallet-r { fill: var(--st-wall-l); }
.dg-wallet-t { fill: var(--st-roof); }

.dg-tank-l { fill: var(--st-trim); }
.dg-tank-r { fill: var(--st-wall-l); }
.dg-tank-t { fill: var(--st-roof); }
.dg-antenna { stroke: var(--st-line); stroke-width: 1.2; }
.dg-pot-l, .dg-pot-r { fill: var(--st-trunk); }
.dg-pot-t { fill: var(--st-tree-light); }

/* ── 사람 그림(story/people.js) ── */

.pp-skin { fill: var(--st-skin); }
.pp-skin-shade { fill: var(--st-skin-shade); }
.pp-hair { fill: var(--st-hair); }
.pp-hair-gray { fill: var(--st-hair-gray); }
.pp-hair-shine { fill: none; stroke: var(--st-trunk); stroke-width: 1.4; stroke-linecap: round; opacity: 0.8; }
.pp-knit { fill: var(--st-knit); }
.pp-shirt { fill: var(--st-shirt); }
.pp-vest { fill: var(--st-vest); }
.pp-cloth-a { fill: var(--st-cloth-a); }
.pp-cloth-b { fill: var(--st-cloth-b); }
.pp-cloth-c { fill: var(--st-cloth-c); }
.pp-seam { fill: none; stroke: var(--st-line); stroke-width: 1; stroke-linecap: round; opacity: 0.45; }
.pp-button { fill: var(--st-paper); }
.pp-blush { fill: var(--st-blush); opacity: 0.7; }
.pp-ink { fill: var(--st-line); }
.pp-shine { fill: var(--st-ink); }
.pp-gold { fill: var(--st-neon-yellow); }
.pp-stroke { fill: none; stroke: var(--st-line); stroke-width: 2; stroke-linecap: round; }
.pp-brow { fill: none; stroke: var(--st-hair); stroke-width: 1.8; stroke-linecap: round; }
.pp-brow-gray { fill: none; stroke: var(--st-wall-r); stroke-width: 1.8; stroke-linecap: round; }
.pp-glasses { fill: none; stroke: var(--st-line); stroke-width: 1.5; }
.pp-shadow { fill: var(--st-line); opacity: 0.35; }
.pp-legs { stroke: var(--st-line); stroke-width: 1.4; stroke-linecap: round; }

/* ── 참여 화면(p/): 불 켜진 창 앞에서 옆집 이웃이 묻는다 ── */

.cs-stage {
  display: grid;
  justify-items: center;
  padding: 4px 12px 0;
}

.cs-scene {
  position: relative;
  width: min(100%, 560px);
  height: 170px;
  overflow: hidden;
  border-radius: 24px;
  background: var(--st-sky);
}

.cs-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cs-glow { fill: var(--st-sky-glow); opacity: 0.75; }
.cs-wall { fill: var(--st-wall-r); }
.cs-wall-2 { fill: var(--st-wall-l); }
.cs-win { fill: var(--st-win-off); }
.cs-win.is-on { fill: var(--st-win-on); }
.cs-ground { fill: var(--st-ground); }

.cs-face {
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 150px;
  height: 150px;
  translate: -50% 0;
  animation: st-breathe 4s ease-in-out infinite;
}

.cs-tag {
  position: absolute;
  top: 12px;
  left: 50%;
  margin: 0;
  padding: 4px 14px;
  border-radius: var(--lm-radius-pill);
  background: var(--st-accent);
  color: var(--st-accent-ink);
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
  translate: -50% 0;
  animation: st-pop 360ms var(--lm-ease-out) both;
}

.pt-dialog {
  margin-top: 14px;
}



/* 결과 판: 예·아니오 한 줄 막대(부드러운 빛), 참여한 수 */
.pr {
  display: grid;
  gap: 12px;
  width: min(calc(100% - 24px), 560px);
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--st-card-line);
  border-radius: 24px;
  background: var(--st-card);
  animation: st-rise 360ms var(--lm-ease-out) both;
}

.pr-q {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--st-ink-muted);
  font-size: 18px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pr-count {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.pr-bar {
  display: flex;
  gap: 4px;
  height: 22px;
}

.pr-bar > span {
  min-width: 6px;
  border-radius: var(--lm-radius-pill);
  transform-origin: left center;
  animation: pr-grow 900ms var(--lm-ease-out) both;
}

.pr-yes {
  background: var(--st-yes);
  box-shadow: 0 0 16px color-mix(in srgb, var(--st-yes) 45%, transparent);
}

.pr-no {
  background: var(--st-no);
  box-shadow: 0 0 16px color-mix(in srgb, var(--st-no) 45%, transparent);
  animation-delay: 120ms;
}

.pr-hid {
  flex: 1 1 auto;
  background: var(--st-masked);
}

.pr-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin: 0;
  padding: 0;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  list-style: none;
}

.pr-legend li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.pr-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.pr-dot.is-yes { background: var(--st-yes); }
.pr-dot.is-no { background: var(--st-no); }

.pr-note {
  margin: 0;
  color: var(--st-ink-muted);
  font-size: 18px;
}

/* ── 3D 단지 그림(complex-orbit.js)을 따뜻한 저녁 빛으로(2026-10-17 사용자 지시 "인포그래픽 3D는 따뜻한 감성으로 살려라") ──
   그림은 host의 --c3o-* 변수를 먼저 읽는다. 한빛아파트(공개 자료)는 사실만 그리고, 찬반 색(예·아니오)은 예시 단지에서만 쓴다 */
.st .c3o {
  --c3o-site: var(--st-ground);
  --c3o-grid: var(--st-path);
  --c3o-face-lit: var(--st-wall-l);
  --c3o-face-dark: var(--st-wall-r);
  --c3o-roof: var(--st-roof);
  --c3o-off: var(--st-win-off);
  --c3o-hover: var(--st-win-honey);
  --c3o-label: var(--st-ink-muted);
  --c3o-shop-lit: var(--st-trim);
  --c3o-shop-dark: var(--st-wall-l);
  --c3o-shop-roof: var(--st-roof);
  --c3o-shop-win: var(--st-win-honey);
  --c3o-shop-edge: var(--st-neon-pink);
  --c3o-ink: var(--st-ink);
  --c3o-halo: var(--st-line);
  --c3o-ring: var(--st-ink-muted);
  --c3o-pin: var(--st-paper);
  --c3o-masked: var(--st-masked);
  --c3o-key-on: var(--st-win-on);
  --c3o-key-yes: var(--st-yes);
  --c3o-key-no: var(--st-no);
  --c3o-key-a1: var(--st-win-honey);
  --c3o-key-a2: var(--st-win-on);
  --c3o-key-a3: var(--st-neon-orange);
  --c3o-key-a4: var(--st-win-peach);
  --c3o-poi-learn: var(--st-win-honey);
  --c3o-poi-care: var(--st-cloth-a);
  --c3o-poi-move: var(--st-neon-sky);
  --c3o-poi-shop: var(--st-no);
  --c3o-poi-park: var(--st-neon-green);
}

.st .c3o__hint {
  color: var(--st-ink-muted);
  font-size: 18px;
}

.st .c3o__reset,
.st .c3o__back {
  border-color: var(--st-card-line);
  border-radius: var(--lm-radius-pill);
  background: var(--st-card);
  color: var(--st-ink);
  font-size: 16px;
  font-weight: 700;
}

.st .c3o__tip,
.st .c3o__detail {
  border-color: var(--st-card-line);
  background: var(--st-card);
  color: var(--st-ink);
}

/* 이야기 속 3D: 단지 그림 자리를 그대로 채운다 */
.dj-orbit {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 0 8px 4px;
  background: var(--st-bg);
  animation: st-fade 600ms var(--lm-ease-out) both;
}

.dj-orbit .c3o__stage {
  min-height: 0;
}

.dj-orbit .c3o__canvas {
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}

.dj-orbit .c3o__hint {
  margin: 4px 0 0;
  text-align: center;
}

.dj-caption {
  width: min(calc(100% - 24px), 560px);
  margin: 0 auto;
  color: var(--st-ink-muted);
  font-size: 17px;
  line-height: 1.5;
  text-align: center;
}

.dj-caption[hidden] {
  display: none;
}

/* 동네 지도(p/map.html): 우리동네 지도 판을 같은 저녁 빛으로. 판 안의 루마닉 공용 이름을 이 판에서만 따뜻한 색으로 다시 정한다 */
.pm-panel {
  --lm-text: var(--st-ink);
  --lm-text-strong: var(--st-ink);
  --lm-text-muted: var(--st-ink-muted);
  --lm-bg-surface: var(--st-card-raised);
  --lm-bg-subtle: var(--st-card);
  --lm-bg-selected: color-mix(in srgb, var(--st-accent) 26%, var(--st-card));
  --lm-border: var(--st-card-line);
  --lm-border-strong: var(--st-card-line);
  --lm-hairline: var(--st-card-line);
  --lm-trust: var(--st-accent);
  --lm-night: var(--st-sky);
  --lm-night-ink: var(--st-ink);
  --lm-night-ink-muted: var(--st-ink-muted);
  --lm-warning-surface: color-mix(in srgb, var(--st-accent) 22%, var(--st-card));
  --lm-warning-text: var(--st-ink);
  width: min(calc(100% - 24px), 720px);
  margin: 0 auto;
  padding: 16px;
  border: 1px solid var(--st-card-line);
  border-radius: 24px;
  background: var(--st-card);
  color: var(--st-ink);
  font-size: 18px;
  line-height: 1.6;
}

/* ── 움직임 ── */

@keyframes st-fade {
  from { opacity: 0; }
}

@keyframes st-rise {
  from { opacity: 0; transform: translateY(8px); }
}

@keyframes st-pop {
  from { opacity: 0; transform: scale(0.85); }
}

@keyframes st-ping {
  from { opacity: 0.9; transform: scale(0.6); }
  to { opacity: 0; transform: scale(1.8); }
}

@keyframes st-caret {
  50% { opacity: 0; }
}

@keyframes st-breathe {
  50% { transform: translateY(-3px); }
}

@keyframes pr-grow {
  from { transform: scaleX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .nw .nw-seg,
  .dj-ping,
  .cs-face,
  .sd.is-typing .sd-text::after {
    animation: none !important;
    opacity: 1;
  }

  .dj-inner,
  .dg-paper,
  .dg-win,
  .dg-walker {
    transition: none !important;
  }

  .dj-paper {
    animation: none !important;
  }
}
