/* 상담방 — 비주얼노벨식 1장면 1질문. 대화창은 한지 두루마리 */
body.consult { background: #050403; overflow: hidden; }
.stage-wrap { height: 100dvh; display: flex; justify-content: center; background: radial-gradient(ellipse at center, #1b1410, #050403); }
.stage { position: relative; width: 100%; max-width: 480px; height: 100%; overflow: hidden; box-shadow: 0 0 80px rgba(0,0,0,.8); }
.stage .scene-svg, .scene-img { position: absolute; inset: 0; width: 100%; height: 100%; background-size: cover; background-position: center; }

.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 6; padding: 12px 16px 14px; display: flex; align-items: center; gap: 12px; background: linear-gradient(rgba(0,0,0,.7), transparent); }
.topbar a { font-size: 26px; color: #f6dc9a; line-height: 1; }
.topbar .ttl { font-family: var(--brush); color: #f6dc9a; font-size: 26px; line-height: 1; white-space: nowrap; }
.progress { flex: 1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--red-glow)); transition: width .5s ease; }
.pcount { font-family: var(--serif); font-size: 12.5px; color: #e2d0ae; white-space: nowrap; }

.halmae-holder { position: absolute; left: 50%; bottom: 33%; width: 80%; max-width: 380px; transform: translateX(-50%); z-index: 2; }
.halmae-holder .halmae-svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 18px 24px rgba(0,0,0,.55)); }
.halmae-holder.bump { animation: bump .45s ease; }
.halmae-holder.shake { animation: shake .5s ease; }
@keyframes bump { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.05) translateY(-8px); } 100% { transform: translateX(-50%) scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(-50%); } 20% { transform: translateX(calc(-50% - 9px)); } 40% { transform: translateX(calc(-50% + 9px)); } 60% { transform: translateX(calc(-50% - 6px)); } 80% { transform: translateX(calc(-50% + 6px)); } }
.halmae-svg .hm-body { animation: breathe 3.6s ease-in-out infinite; transform-origin: 200px 500px; }
.halmae-svg .hm-eyes { animation: blink 4.2s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes breathe { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.012) translateY(-2px); } }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.scene-svg .lantern { animation: flicker 3s ease-in-out infinite; }
.scene-svg .star { animation: twinkle 4s ease-in-out infinite; }
@keyframes flicker { 0%,100% { opacity: 1; } 45% { opacity: .82; } 55% { opacity: .95; } }
@keyframes twinkle { 0%,100% { opacity: .25; } 50% { opacity: .9; } }
/* 일러스트 모드 */
.halmae-holder.is-img { width: 92%; max-width: 420px; bottom: 30%; }
.halmae-holder.is-img img { width: 100%; display: block; filter: drop-shadow(0 18px 24px rgba(0,0,0,.55)); animation: breatheImg 3.6s ease-in-out infinite; transform-origin: 50% 100%; }
.halmae-holder.is-img.talking img { animation: talkImg .32s ease-in-out infinite alternate; }
@keyframes breatheImg { 0%,100% { transform: scale(1); } 50% { transform: scale(1.01) translateY(-2px); } }
@keyframes talkImg { from { transform: translateY(0) rotate(-.4deg); } to { transform: translateY(-3px) rotate(.4deg); } }

.table-holder { position: absolute; left: 50%; bottom: calc(33% - 70px); width: 104%; max-width: 500px; transform: translateX(-50%); z-index: 3; pointer-events: none; }
.table-holder svg { width: 100%; display: block; filter: drop-shadow(0 -6px 18px rgba(0,0,0,.5)); }

/* 대화창: 한지 */
.dialog {
  position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 5;
  min-height: 31%; max-height: 62%; overflow-y: auto;
  background: #f4ead3 url('/img/texture/hanji.jpg') center/cover; color: var(--text-on-paper);
  border-radius: 14px; padding: 46px 18px 18px;
  box-shadow: 0 -10px 40px rgba(0,0,0,.55), inset 0 0 0 2px rgba(107,68,35,.35), inset 0 0 0 6px rgba(244,234,211,.6), inset 0 0 0 7px rgba(107,68,35,.25);
}
.dialog .nametag { position: absolute; top: 10px; left: 14px; display: inline-flex; align-items: center; gap: 6px; background: var(--red); color: #fff3e6; font-family: var(--brush); font-size: 24px; line-height: 1; padding: 4px 12px 3px; border-radius: 6px; transform: rotate(-2deg); box-shadow: 0 2px 0 var(--red-2); }
.dialog .line { font-family: var(--body); font-weight: 700; font-size: 18.5px; line-height: 1.65; min-height: 3.3em; white-space: pre-wrap; color: #24180f; }
.dialog .line .caret { display: inline-block; width: 8px; height: 1em; background: var(--red); vertical-align: -2px; margin-left: 3px; animation: caret .8s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.dialog .controls { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.dialog .row { display: flex; gap: 8px; }
.dialog .row > * { flex: 1; }
.dialog .pf { display: grid; gap: 8px; margin-bottom: 8px; }
.dialog .pf .choices { margin: 0; }
.dialog .pf input:disabled { opacity: .4; }
.dialog .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dialog .choices.one { grid-template-columns: 1fr; }
.dialog .choices.three { grid-template-columns: 1fr 1fr 1fr; }
.dialog .choice {
  padding: 13px 10px; border-radius: 10px; cursor: pointer; text-align: center;
  background: rgba(255,252,244,.75); border: 1.5px solid rgba(107,68,35,.4); color: #2b1f17; font-family: var(--serif); font-size: 16px;
  box-shadow: 0 2px 0 rgba(107,68,35,.25); transition: background .15s, transform .1s;
}
.dialog .choice:hover { background: #fff; border-color: var(--red); }
.dialog .choice:active { transform: translateY(2px); box-shadow: none; }
.dialog .choice.on { background: var(--red); border-color: var(--red-2); color: #fff; }
.dialog .choice small { font-family: var(--body); }
.dialog select, .dialog textarea, .dialog input {
  width: 100%; padding: 13px 14px; border-radius: 10px; font-size: 16px; font-family: var(--body); font-weight: 700;
  background: rgba(255,252,244,.85); color: #24180f; border: 1.5px solid rgba(107,68,35,.45); outline: none;
}
.dialog textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.dialog input:focus, .dialog select:focus, .dialog textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(194,59,34,.15); }
.dialog .hint { font-size: 12.5px; color: #7a6650; line-height: 1.5; }
.dialog .err { color: var(--red); font-size: 13.5px; min-height: 1em; font-weight: 700; }
.dialog .skip { background: none; border: 0; color: #7a6650; text-decoration: underline; font-family: inherit; font-size: 14px; cursor: pointer; padding: 4px; }
.dialog .btn.ghost { color: #2b1f17; border-color: rgba(107,68,35,.5); }

.summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; background: rgba(255,252,244,.7); border: 1px dashed rgba(107,68,35,.4); padding: 12px 14px; border-radius: 10px; margin: 0; }
.summary dt { color: #8a7258; font-family: var(--serif); }
.summary dd { margin: 0; font-weight: 700; }

.mini-chart { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; background: rgba(255,252,244,.6); border: 1.5px solid #3a2a1e; border-radius: 8px; padding: 6px; }
.mini-chart .col { padding: 4px 2px; border-radius: 6px; }
.mini-chart .col:nth-child(2) { background: rgba(194,59,34,.1); }
.mini-chart .lbl { font-family: var(--serif); font-size: 12px; color: var(--red-2); }
.mini-chart .ch { font-family: 'Song Myung'; font-size: 28px; line-height: 1.3; margin: 3px auto; width: 46px; border-radius: 7px; color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.mini-chart .tg { font-size: 11.5px; color: #5a4636; }

.gen-box { text-align: center; }
.gen-box .brush { font-size: 40px; display: inline-block; animation: brushmove 1.2s ease-in-out infinite; }
@keyframes brushmove { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg) translateX(6px); } }
.gen-bar { height: 10px; border-radius: 99px; background: rgba(107,68,35,.15); overflow: hidden; margin: 10px 0; }
.gen-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(45deg, var(--gold) 0 10px, var(--red) 10px 20px); transition: width .6s; }
.price-tag { font-family: var(--serif); font-size: 28px; color: #24180f; }

/* 첫 장면 영상 */
.intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 4; transition: opacity .6s; }
.intro-video.out { opacity: 0; }
body.has-intro-video .halmae-holder, body.has-intro-video .table-holder { visibility: hidden; }

/* ---------- 그림 모드: 배경 · 할매 · 앞쪽 상을 한 캔버스(2:3)에 겹침 ---------- */
.stage { container-type: size; background: #120b07; }
.canvas {
  --cw: max(100cqw, 50cqh);   /* 대화창이 아래 3분의 1을 덮으므로 캔버스는 무대를 다 채울 필요가 없다 */
  position: absolute; left: 50%; width: var(--cw); aspect-ratio: 2 / 3; z-index: 1;
  /* 상 윗면이 대화창 바로 위(무대 높이 62%)에 오도록 캔버스를 올린다 */
  top: min(0px, calc(62cqh - var(--ttg) * var(--cw) * 1.5));
  transform: translateX(-50%); overflow: hidden;
}
.canvas::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 38%, transparent 55%, rgba(10,5,2,.55)); }
.canvas .cz { position: absolute; inset: 0; transform-origin: 0 0; }
.canvas .scene-img { position: absolute; inset: 0; background-size: 100% 100%; }
.canvas .scene-img.fg { z-index: 2; }
.canvas .slot { position: absolute; z-index: 1; aspect-ratio: 2 / 3; }
.canvas .halmae-holder.is-img { position: absolute; inset: 0; left: 0; bottom: auto; width: 100%; max-width: none; transform: none; }
.canvas .halmae-holder.is-img .hx, .canvas .halmae-holder.is-img img { width: 100%; height: 100%; }
.canvas .halmae-holder.is-img img { object-fit: contain; filter: drop-shadow(0 14px 18px rgba(0,0,0,.45)); transform-origin: 50% 85%; }
.canvas .halmae-holder.bump { animation: bumpImg .45s ease; }
.canvas .halmae-holder.shake { animation: shakeImg .5s ease; }
@keyframes bumpImg { 40% { transform: scale(1.04) translateY(-6px); } }
@keyframes shakeImg { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.canvas .intro-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 4; }
body.img-mode .dialog { min-height: 30%; background-color: rgba(244,234,211,.97); }
body.img-mode.has-intro-video .halmae-holder { visibility: visible; }

/* ---------- 무통장 주문서 · 입금 안내 ---------- */
.order-card { background: rgba(255,250,240,.75); border: 1px solid #d7c39c; border-radius: 12px; padding: 10px 12px; text-align: left; }
.order-card .oc-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14.5px; }
.order-card .oc-top b { font-size: 19px; color: #b8321f; }
.oc-steps { list-style: none; display: flex; gap: 4px; padding: 0; margin: 8px 0 0; counter-reset: s; }
.oc-steps li { flex: 1; font-size: 11.5px; line-height: 1.3; color: #8e7d66; text-align: center; padding-top: 22px; position: relative; counter-increment: s; }
.oc-steps li::before { content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 18px; height: 18px; border-radius: 50%; background: #e4d6b8; color: #6b5a44; font-size: 11px; line-height: 18px; font-weight: 700; }
.oc-steps li.on { color: #2a1d14; font-weight: 700; }
.oc-steps li.on::before { background: #b8321f; color: #fff; }
.controls .fl { display: block; text-align: left; font-size: 14px; font-weight: 700; margin: 6px 0 -4px; color: #3b2a1a; }
.controls .fl b { color: #b8321f; }
.controls .fl span { font-weight: 400; font-size: 12.5px; color: #8e7d66; margin-left: 4px; }
.controls .agree { display: flex; gap: 8px; align-items: flex-start; text-align: left; font-size: 12.8px; line-height: 1.5; color: #4a3826; background: rgba(184,50,31,.06); border-radius: 10px; padding: 9px 10px; cursor: pointer; }
.controls .agree input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; accent-color: #b8321f; }
.bank-card { background: #fffaf0; border: 1.5px solid #b8321f; border-radius: 12px; padding: 4px 12px; text-align: left; box-shadow: 0 6px 16px rgba(80,40,10,.12); }
.bank-card .bk-row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #e0cfab; align-items: flex-start; }
.bank-card .bk-row:last-child { border-bottom: 0; }
.bank-card .bk-row > span { flex: none; width: 62px; font-size: 13px; color: #8e7d66; padding-top: 2px; }
.bank-card .bk-row > div { flex: 1; font-size: 15px; line-height: 1.45; }
.bank-card small { display: block; font-size: 12.5px; color: #8e7d66; }
.bank-card .amt { color: #b8321f; font-size: 18px; }
.copy { margin-left: 6px; font-size: 12px; padding: 3px 8px; border-radius: 6px; border: 1px solid #c9b48c; background: #f4ead3; color: #4a3826; cursor: pointer; vertical-align: 1px; }
.copy.done { background: #2f7a3d; color: #fff; border-color: #2f7a3d; }
.controls .hint.left { text-align: left; line-height: 1.55; }

/* 복채 봉투 장식 · 집필 영상 */
.order-card, .bank-card { position: relative; }
.order-card .bokchae, .bank-card .bokchae { position: absolute; right: -10px; top: -34px; width: 96px; transform: rotate(8deg); filter: drop-shadow(0 6px 8px rgba(60,30,10,.3)); pointer-events: none; }
.order-card .oc-top { padding-right: 76px; }
.bank-card .bk-row:first-of-type > div { padding-right: 58px; }
.intro-video.writing { transition: opacity .6s; }
.intro-video.writing.out { opacity: 0; }
