/* 운새록 — 밤의 골목, 연지색 등불, 한지 */
:root {
  --ink: #14110f;
  --ink-2: #1e1916;
  --ink-3: #2a231f;
  --yeonji: #c8322b;
  --yeonji-deep: #8e1d1a;
  --gold: #c9a45c;
  --gold-soft: #e6d3a3;
  --hanji: #f3ead9;
  --hanji-line: #dccfb6;
  --text: #efe6d8;
  --muted: #a3968a;
  --serif: "Gowun Batang", "Nanum Myeongjo", serif;
  --display: "Song Myung", "Gowun Batang", serif;
  --round: "Gowun Dodum", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --col: 520px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font-family: var(--round); font-size: 16px; line-height: 1.7;
  word-break: keep-all; overflow-wrap: anywhere;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(200, 50, 43, .22), transparent 60%),
    radial-gradient(800px 500px at 100% 40%, rgba(201, 164, 92, .06), transparent 60%),
    var(--ink);
  min-height: 100vh;
}
body::before { /* 종이 결 */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.testbar { background: var(--gold); color: var(--ink); text-align: center; font-size: 12px; padding: 4px 8px; letter-spacing: .02em; }

/* 머리 */
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 16px; max-width: 1200px; margin: 0 auto; }
.top::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(201,164,92,.45) 20%, rgba(201,164,92,.45) 80%, transparent); }
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--display); font-size: 23px; letter-spacing: .22em; color: var(--hanji); }
.seal { display: inline-grid; place-items: center; width: 34px; height: 34px; background: var(--yeonji); color: var(--hanji); border-radius: 3px; font-family: var(--display); font-size: 20px; letter-spacing: 0; transform: rotate(-3deg);
  box-shadow: inset 0 0 0 2px var(--yeonji), inset 0 0 0 3px rgba(243,234,217,.55), 0 4px 14px rgba(200,50,43,.35); }
.top-link { font-size: 14px; letter-spacing: .12em; color: var(--gold-soft); text-decoration: none; padding: 6px 2px; border-bottom: 1px solid rgba(201,164,92,.5); }
.jump { font-size: 14px; text-decoration: none; border: 1px solid var(--gold); color: var(--gold-soft); padding: 6px 14px; border-radius: 999px; }

/* 나타나기 */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.d1 { transition-delay: .08s; } .d2 { transition-delay: .16s; } .d3 { transition-delay: .24s; } .d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- 첫 화면 ---------- */
/* 한옥 골목 배경: 머리부터 카드 윗부분까지 깔리고 아래로 먹색에 녹는다 */
.backdrop { position: absolute; top: 0; left: 0; right: 0; z-index: 0; height: clamp(640px, 56vw, 940px); overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 62%, transparent 100%); mask-image: linear-gradient(180deg, #000 62%, transparent 100%); }
.backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; filter: brightness(.82); animation: drift 24s ease-in-out infinite alternate; }
.backdrop::after { content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 46% 38% at 50% 36%, rgba(20,17,15,.62), transparent 100%),
    linear-gradient(180deg, rgba(20,17,15,.85) 0, rgba(20,17,15,.45) 11%, rgba(20,17,15,.12) 20%, rgba(20,17,15,0) 40%, rgba(20,17,15,.5) 75%, rgba(20,17,15,.8) 100%); }
@keyframes drift { to { transform: scale(1.05); } }
@media (max-width: 760px) {
  .backdrop { height: min(160vw, 860px); }
  .backdrop img { object-position: 50% 0; }
  .backdrop::after { background:
    radial-gradient(ellipse 70% 30% at 50% 40%, rgba(20,17,15,.6), transparent 100%),
    linear-gradient(180deg, rgba(20,17,15,.92) 0, rgba(20,17,15,.75) 9%, rgba(20,17,15,.2) 20%, rgba(20,17,15,0) 30%, rgba(20,17,15,0) 55%, rgba(20,17,15,.55) 80%, rgba(20,17,15,.8) 100%); }
}
@media (prefers-reduced-motion: reduce) { .backdrop img { animation: none; } }
.home .hero { padding: clamp(72px, 9vw, 120px) 20px clamp(120px, 16vw, 230px); }
@media (min-width: 761px) and (max-width: 1300px) { .home .hero { padding-bottom: 96px; } }
@media (max-width: 760px) { .home .hero { padding: 96px 20px 132px; } }
.home .hero .sub { color: rgba(243,234,217,.78); text-shadow: 0 1px 10px rgba(0,0,0,.8); }
.home .hero h1 .h-side, .home .kicker { text-shadow: 0 1px 12px rgba(0,0,0,.85); }
.home .logo, .home .top-link { text-shadow: 0 1px 10px rgba(0,0,0,.9), 0 0 2px rgba(0,0,0,.6); }
.hero { text-align: center; padding: 56px 20px 40px; max-width: 860px; margin: 0 auto; position: relative; isolation: isolate; }
.kicker { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--gold); font-size: 13px; letter-spacing: .18em; margin: 0 0 22px; }
.kicker::before, .kicker::after { content: ""; width: 36px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.kicker::after { transform: scaleX(-1); }
.hero h1 { font-family: var(--display); font-weight: 400; margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero h1 .h-side { font-size: clamp(20px, 4.6vw, 28px); color: var(--gold-soft); letter-spacing: .14em; line-height: 1.4; }
.hero h1 .h-main { font-size: clamp(40px, 10.4vw, 74px); color: var(--hanji); line-height: 1.2; letter-spacing: -.01em; text-shadow: 0 6px 40px rgba(200,50,43,.35); }
.hero h1 em { font-style: normal; background: linear-gradient(180deg, #f6e7be, var(--gold) 70%, #a9823f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .sub { color: var(--muted); margin: 22px 0 0; font-size: 15px; letter-spacing: .02em; }

.doors { display: grid; gap: 18px; padding: 12px 16px 40px; max-width: 1200px; margin: 0 auto; grid-template-columns: 1fr; }
@media (min-width: 640px) { .doors { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .doors { grid-template-columns: repeat(4, 1fr); } }

.door { position: relative; display: block; border-radius: 18px; overflow: hidden; text-decoration: none; background: var(--ink-2); border: 1px solid rgba(201,164,92,.25); aspect-ratio: 3 / 4; isolation: isolate; }
.door-img { position: absolute; inset: 0; z-index: -1; }
.door-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 14%; transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.door::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 34%, rgba(20,17,15,.62) 56%, rgba(20,17,15,.97) 100%); }
.door-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 22px 24px; }
.door .role { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .12em; color: var(--gold-soft); background: rgba(20,17,15,.78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border: 1px solid rgba(201,164,92,.55); border-radius: 999px; padding: 4px 12px; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.door h2 { font-family: var(--display); font-weight: 400; font-size: 36px; letter-spacing: .04em; text-shadow: 0 2px 14px rgba(0,0,0,.6); margin: 10px 0 4px; line-height: 1.15; display: flex; align-items: baseline; gap: 10px; }
.door h2 small { font-size: 14px; color: var(--gold-soft); opacity: .85; letter-spacing: .1em; font-weight: 400; }
.door .hook { text-wrap: balance; text-shadow: 0 1px 8px rgba(0,0,0,.55); }
.door .hook { margin: 0 0 14px; font-size: 17px; color: var(--hanji); }
.door .enter { display: inline-flex; align-items: center; gap: 8px; background: var(--yeonji); color: #fff; padding: 11px 20px; border-radius: 999px; font-weight: 700; box-shadow: 0 8px 24px rgba(200,50,43,.4); }
.door .enter i { font-style: normal; transition: transform .3s; }
.door.open:hover .door-img img { transform: scale(1.04); }
.door.open:hover .enter i { transform: translateX(4px); }
.door.open { box-shadow: 0 20px 60px -20px rgba(200,50,43,.55); border-color: rgba(200,50,43,.6); }
.door.shut { cursor: default; aspect-ratio: 3 / 4; }
@media (max-width: 639px) { .door.shut { aspect-ratio: 16 / 9; } .door.shut h2 { font-size: 26px; } }
.door.shut .door-img { background: repeating-linear-gradient(90deg, var(--ink-2) 0 46px, var(--ink-3) 46px 48px), var(--ink-2); }
.door.shut .glyph { position: absolute; right: -6%; top: -8%; font-family: var(--serif); font-size: 260px; line-height: 1; color: rgba(201,164,92,.09); }
.door.shut::after { background: linear-gradient(180deg, transparent 20%, rgba(20,17,15,.85) 100%); }
.door.shut .hook { color: var(--muted); }
.door .soon { display: inline-block; font-size: 13px; color: var(--gold); border: 1px dashed rgba(201,164,92,.6); padding: 6px 14px; border-radius: 6px; }

.how { max-width: 760px; margin: 0 auto; padding: 8px 20px 48px; }
.how h3 { font-family: var(--serif); color: var(--gold); font-size: 18px; letter-spacing: .1em; margin: 0 0 12px; }
.how ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: s; }
.how li { counter-increment: s; display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; background: rgba(243,234,217,.04); border: 1px solid rgba(243,234,217,.08); border-radius: 12px; padding: 14px 16px; }
.how li::before { content: counter(s); grid-row: span 2; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--yeonji-deep); font-family: var(--serif); font-weight: 700; }
.how li span { color: var(--muted); font-size: 14px; }
/* 받는 법 세 단계: 화면에 들어오면 하나씩 차례로 */
.steps li { opacity: 0; transform: translateX(-28px); transition: opacity .55s ease, transform .6s cubic-bezier(.2,.8,.2,1), border-color .6s; }
.steps li::before { transform: scale(.3); opacity: 0; transition: transform .5s cubic-bezier(.34,1.7,.5,1), opacity .3s, box-shadow .8s; }
.steps.in li { opacity: 1; transform: none; border-color: rgba(201,164,92,.22); }
.steps.in li::before { transform: none; opacity: 1; box-shadow: 0 0 0 4px rgba(200,50,43,.18); }
.steps.in li:nth-child(2) { transition-delay: .22s; }
.steps.in li:nth-child(3) { transition-delay: .44s; }
.steps.in li:nth-child(1)::before { transition-delay: .15s; }
.steps.in li:nth-child(2)::before { transition-delay: .37s; }
.steps.in li:nth-child(3)::before { transition-delay: .59s; }
@media (prefers-reduced-motion: reduce) { .steps li, .steps li::before { opacity: 1; transform: none; transition: none; } }

/* ---------- 웹툰 ---------- */
.toon { max-width: var(--col); margin: 0 auto; padding: 8px 0 24px; }
.panel { position: relative; margin: 0 0 14px; overflow: hidden; }
@media (min-width: 540px) { .panel { border-radius: 14px; } }
.panel img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 16%; }
.panel::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px rgba(0,0,0,.35); }

/* 이름표 대사창 — 그림 아래를 먹빛으로 깔고 금색 이름표 아래 대사 */
.line { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; margin: 0; padding: 56px 22px 22px;
  background: linear-gradient(180deg, transparent, rgba(14,11,9,.86) 34%, rgba(14,11,9,.96)); color: var(--hanji); }
.line .name { display: inline-block; font-family: var(--round); font-weight: 700; font-size: 13px; letter-spacing: .15em; color: var(--ink);
  background: linear-gradient(90deg, var(--gold), var(--gold-soft)); padding: 3px 14px 3px 10px; margin-bottom: 9px;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%); }
.line p { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.75; }
.line b { color: #e6b36a; font-weight: 700; }
.line small { color: var(--muted); font-size: 14px; }
.line .s { display: inline-block; }
.line .s + br + .s { margin-top: 6px; }
.line .more { position: absolute; right: 20px; bottom: 16px; color: var(--gold); font-size: 12px; font-style: normal; animation: blink 1.2s infinite; }
.line.big p { font-size: 25px; line-height: 1.5; }
.line.big { padding-top: 70px; }
@keyframes blink { 50% { opacity: .2; } }
.panel .line .name, .panel .line .s, .panel .line .more { opacity: 0; }
.panel.in .line .name { animation: rise .5s .25s both; }
.panel.in .line .s { animation: rise .7s .55s both; }
.panel.in .line .s ~ .s { animation-delay: 1.5s; }
.panel.in .line .more { animation: rise .4s 2.2s both, blink 1.2s 2.6s infinite; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .panel .line .name, .panel .line .s, .panel .line .more { opacity: 1; animation: none; } }

.narr { margin: 26px 20px; padding: 14px 18px; border-left: 3px solid var(--gold); font-family: var(--serif); color: var(--gold-soft); font-size: 16px; line-height: 1.8; background: linear-gradient(90deg, rgba(201,164,92,.08), transparent); }
.narr small { color: var(--muted); }

.choices { display: grid; gap: 10px; padding: 4px 20px 22px; }
.choices button { font: inherit; font-size: 17px; text-align: left; padding: 15px 18px; border-radius: 14px; border: 1.5px solid var(--gold); background: rgba(243,234,217,.05); color: var(--hanji); cursor: pointer; transition: background .2s, transform .15s; }
.choices button:hover { background: rgba(201,164,92,.15); }
.choices button:active { transform: scale(.98); }
.choices button.ghost { border-style: dashed; border-color: rgba(201,164,92,.5); color: var(--muted); }
.choices button.picked { background: var(--yeonji); border-color: var(--yeonji); color: #fff; }
.choices.done button:not(.picked) { opacity: .35; }
.reply { animation: fadein .7s both; }
@keyframes fadein { from { opacity: 0; transform: translateY(14px); } }

.scroll-list { list-style: none; margin: -6px 20px 18px; padding: 18px 20px; background: var(--hanji); color: #2a211c; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.4); border-top: 6px solid var(--yeonji-deep); border-bottom: 6px solid var(--yeonji-deep); }
.scroll-list li { padding: 8px 0 8px 22px; position: relative; border-bottom: 1px dashed var(--hanji-line); font-size: 16.5px; }
.scroll-list li:last-child { border-bottom: 0; }
.scroll-list li::before { content: "❋"; position: absolute; left: 0; color: var(--yeonji); font-size: 13px; top: 11px; }
.scroll-list b { color: var(--yeonji-deep); }

.preview { display: flex; gap: 16px; align-items: center; margin: 4px 20px 22px; padding: 16px; border: 1px solid rgba(201,164,92,.35); border-radius: 16px; background: rgba(30,25,22,.8); }
.preview img { width: 112px; border-radius: 4px; box-shadow: 6px 8px 0 rgba(200,50,43,.35), 0 10px 24px rgba(0,0,0,.5); transform: rotate(-3deg); flex: none; }
.preview ul { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.preview li { padding: 3px 0; }
.preview li b { color: var(--gold-soft); }

/* ---------- 입력 ---------- */
.ask { max-width: var(--col); margin: 0 auto; padding: 0 12px 40px; scroll-margin-top: 12px; }
.hanji { background: var(--hanji); color: #2a211c; border-radius: 18px; padding: 26px 20px 22px; box-shadow: 0 30px 80px -30px rgba(200,50,43,.5), 0 2px 0 rgba(255,255,255,.4) inset; position: relative; }
.hanji::before { content: "運"; position: absolute; top: -14px; right: 18px; width: 40px; height: 40px; display: grid; place-items: center; background: var(--yeonji); color: var(--hanji); font-family: var(--display); font-size: 23px; border-radius: 6px; transform: rotate(6deg); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.hanji h2 { font-family: var(--serif); font-size: clamp(18px, 6vw, 26px); white-space: nowrap; letter-spacing: -.01em; margin: 0 0 18px; color: #2a211c; }
.hanji h2 span { color: var(--yeonji); }
.f { display: block; border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.say { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 16px; font-weight: 700; margin-bottom: 8px; padding: 0; color: #2a211c; }
.say::before { content: ""; width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--say-avatar, url(/static/img/seonnyeo/05_warm_smile.webp)) 50% 12% / 230% no-repeat; border: 2px solid var(--say-ring, var(--yeonji)); }
.say small { font-weight: 400; color: #8a7a6c; font-size: 13px; flex-basis: 100%; padding-left: 44px; margin-top: -6px; }
.hanji input[type=text], .hanji input:not([type]), .hanji input[type=email], .hanji input[type=date], .hanji input[type=time], .hanji textarea {
  width: 100%; font: inherit; font-size: 17px; color: #2a211c; background: #fffdf7; border: 1.5px solid var(--hanji-line); border-radius: 12px; padding: 13px 14px; margin-top: 6px; outline: none; transition: border-color .2s, box-shadow .2s; }
.hanji input:focus, .hanji textarea:focus { border-color: var(--yeonji); box-shadow: 0 0 0 3px rgba(200,50,43,.15); }
.hanji input:disabled { opacity: .4; }
.seg { display: flex; gap: 8px; margin-top: 6px; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 12px; border-radius: 12px; border: 1.5px solid var(--hanji-line); background: #fffdf7; cursor: pointer; font-size: 16px; }
.seg input:checked + span { background: #2a211c; color: var(--hanji); border-color: #2a211c; }
.seg input:focus-visible + span { outline: 2px solid var(--yeonji); outline-offset: 2px; }
.seg.small span { padding: 9px; font-size: 15px; }
.check { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; font-size: 15px; margin-top: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--yeonji); margin-top: 3px; flex: none; }
.check small { flex-basis: 100%; padding-left: 26px; color: #8a7a6c; font-size: 12.5px; margin-top: -4px; }
.check a { color: var(--yeonji-deep); }
.err { color: var(--yeonji); font-size: 13px; font-style: normal; }
.agree { border-top: 1px dashed var(--hanji-line); padding-top: 8px; margin-top: 4px; }
.agree .all { font-size: 16px; padding-bottom: 6px; border-bottom: 1px solid var(--hanji-line); margin-bottom: 4px; }
.pay { margin-top: 22px; }
.price { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 2px; border-top: 2px solid #2a211c; }
.price b { font-family: var(--serif); font-size: 26px; color: var(--yeonji); }
.cta { width: 100%; font: inherit; font-size: 19px; font-weight: 700; padding: 17px; border: 0; border-radius: 14px; background: var(--yeonji); color: #fff; cursor: pointer; box-shadow: 0 10px 26px rgba(200,50,43,.45); transition: transform .15s, opacity .2s; }
.cta:active { transform: scale(.98); }
.cta:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.note { font-size: 13px; color: #8a7a6c; text-align: center; margin: 10px 0 0; }

/* ---------- 완료·약관 ---------- */
.testnote { margin: 0 20px; font-size: 13px; color: var(--ink); background: var(--gold); padding: 8px 12px; border-radius: 8px; text-align: center; }
.back { text-align: center; margin: 22px 0; }
.back a { color: var(--gold-soft); }
.legal { max-width: 720px; margin: 0 auto; padding: 10px 22px 30px; }
.legal h1 { font-family: var(--serif); }
.legal h1 small { font-size: 14px; color: var(--muted); }
.legal h2 { font-size: 17px; color: var(--gold); margin-top: 26px; }
.legal p, .legal li { color: #d8cdbd; }
.legal-t { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 4px; }
.legal-t th, .legal-t td { border: 1px solid rgba(201,162,92,.3); padding: 8px; text-align: left; vertical-align: top; color: #d8cdbd; }
.legal-t th { color: var(--gold); font-weight: 600; }

/* 바닥 */
.foot { max-width: 760px; margin: 0 auto; padding: 28px 20px 40px; border-top: 1px solid rgba(243,234,217,.08); font-size: 12.5px; color: var(--muted); }
.foot nav { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.foot nav a { text-decoration: none; color: #cfc3b3; }
.foot .disc { line-height: 1.6; }
.foot .biz { line-height: 1.8; }

/* ---------- 컷툰: 한 장씩 넘기기 ---------- */
body.story-on { overflow: hidden; }
.story { position: fixed; inset: 0; z-index: 50; background: radial-gradient(600px 400px at 50% 30%, rgba(200,50,43,.18), transparent 70%), #0d0a08; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.story[hidden] { display: none; }
.story > .slide { position: absolute; inset: 0; margin: 0 auto; max-width: 480px; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility 0s .5s; overflow: hidden; }
.story > .slide.on { opacity: 1; visibility: visible; transition: opacity .5s ease; }
.story .panel { border-radius: 0; margin: 0 auto; }
.story .panel img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: 50% 18%; transform: scale(1.04); transition: transform 6s ease-out; }
.story .panel.on img { transform: scale(1); }
.story .line { padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
.story .line p { font-size: 19px; }
.story .line.big p { font-size: 27px; }

.narr-slide, .list-slide, .preview-slide { display: grid; place-items: center; padding: 0 28px; }
.narr-slide p { margin: 0; font-family: var(--serif); font-size: 22px; line-height: 1.9; color: var(--gold-soft); text-align: center; }
.narr-slide p::before, .narr-slide p::after { content: ""; display: block; width: 36px; height: 1px; background: var(--gold); margin: 18px auto; opacity: .6; }
.narr-slide.on p { animation: rise 1s .2s both; }
.list-slide .scroll-list { margin: 0; width: 100%; }
.list-slide.on .scroll-list li { animation: rise .6s both; }
.list-slide.on .scroll-list li:nth-child(2) { animation-delay: .5s; }
.list-slide.on .scroll-list li:nth-child(3) { animation-delay: 1s; }
.list-slide.on .scroll-list li:nth-child(4) { animation-delay: 1.5s; }
.preview-slide .preview { margin: 0; width: 100%; }
.preview-slide.on .preview { animation: rise .8s both; }
/* 리포트 목차 미리보기 */
.preview-slide:has(.toc-card) { padding: 64px 16px 24px; }
.toc-card { display: block; padding: 16px 18px 14px; background: rgba(24,20,17,.92); }
.toc-head { display: flex; gap: 14px; align-items: center; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid rgba(201,164,92,.3); }
.toc-head img { width: 54px; box-shadow: 4px 5px 0 rgba(200,50,43,.35), 0 6px 14px rgba(0,0,0,.5); }
.toc-kicker { display: block; font-size: 11.5px; letter-spacing: .2em; color: var(--gold); }
.toc-title { display: block; font-family: var(--display); font-weight: 400; font-size: 21px; line-height: 1.3; color: var(--hanji); }
.toc-meta { display: block; font-size: 12.5px; color: var(--muted); }
.toc { list-style: none; margin: 0; padding: 0; counter-reset: t; display: grid; gap: 8px; }
.toc li { counter-increment: t; display: grid; grid-template-columns: 26px 1fr; padding: 0; font-size: 15px; line-height: 1.4; }
.toc li::before { content: counter(t, decimal-leading-zero); grid-row: span 2; font-family: var(--display); font-size: 13px; color: var(--gold); padding-top: 2px; }
.toc li b { font-weight: 400; color: var(--hanji); }
.toc li small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.toc li.q b { color: var(--gold-soft); font-weight: 700; }
.toc.mid { gap: 6px; }
.toc.mid li { font-size: 14.5px; }
.toc.dense { gap: 3px; }
.toc.dense li { font-size: 14px; }
.toc.dense li small { display: none; }
@media (max-height: 760px) { .toc.mid small { display: none; } .toc.mid { gap: 4px; } }
.preview-slide.on .toc-card { animation: none; }
.preview-slide.on .toc-head { animation: rise .6s both; }
.preview-slide.on .toc li { animation: rise .5s both; animation-delay: calc(.25s + var(--i) * .07s); }
@media (prefers-reduced-motion: reduce) { .preview-slide.on .toc li, .preview-slide.on .toc-head { animation: none; } }

.bars { position: absolute; z-index: 5; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(456px, calc(100% - 24px)); display: flex; gap: 4px; pointer-events: none; }
.bars i { flex: 1; height: 3px; border-radius: 3px; background: rgba(243,234,217,.22); overflow: hidden; }
.bars i b { display: block; height: 100%; width: 0; background: var(--gold-soft); }
.bars i.past b { width: 100%; }
.story-top { position: absolute; z-index: 5; top: calc(20px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(456px, calc(100% - 24px)); display: flex; justify-content: space-between; align-items: center; }
.story-top .who { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 14px; color: var(--hanji); text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.story-top .who img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: 50% 10%; border: 1.5px solid var(--gold); }
.story-top .skip { font: inherit; font-size: 13px; color: var(--hanji); background: rgba(13,10,8,.45); border: 1px solid rgba(243,234,217,.3); border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.hint { position: absolute; z-index: 5; left: 50%; bottom: calc(14% + env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; padding: 9px 16px; border-radius: 999px; background: rgba(13,10,8,.7); color: var(--gold-soft); font-size: 14px; pointer-events: none; animation: hint 1.6s ease-in-out infinite; transition: opacity .4s; }
.hint.gone { opacity: 0; animation: none; }
@keyframes hint { 50% { transform: translateX(-50%) translateY(-6px); } }

.ask-slide .choices { padding: 16px 0 0; gap: 9px; }
.ask-slide .choices button { padding: 13px 16px; font-size: 16px; background: rgba(13,10,8,.55); backdrop-filter: blur(4px); opacity: 0; }
.ask-slide.on .choices button { animation: rise .5s both; }
.ask-slide.on .choices button:nth-child(1) { animation-delay: 1.1s; }
.ask-slide.on .choices button:nth-child(2) { animation-delay: 1.25s; }
.ask-slide.on .choices button:nth-child(3) { animation-delay: 1.4s; }
.ask-slide.on .choices button:nth-child(4) { animation-delay: 1.55s; }
.ask-slide .line { padding-top: 120px; }
.last-slide .open-ask { margin-top: 18px; opacity: 0; }
.last-slide.on .open-ask { animation: rise .6s 1.4s both; }
.replay { display: block; margin: 22px auto 16px; font: inherit; font-size: 14px; color: var(--gold-soft); background: none; border: 1px solid rgba(201,164,92,.5); border-radius: 999px; padding: 7px 16px; cursor: pointer; }
.choices.nudge { animation: nudge .45s; }
@keyframes nudge { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
/* 아이폰에서 꾹 눌러 멈출 때 '이미지 저장' 메뉴가 뜨지 않게 */
.story, .story img { -webkit-touch-callout: none; }
.story img { pointer-events: none; -webkit-user-drag: none; }

/* 아이폰 사파리: 날짜·시간 칸이 자체 최소 너비 때문에 삐져나오지 않게 */
.hanji input[type=date], .hanji input[type=time] {
  -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%;
  min-height: 52px; text-align: left; line-height: 1.4; }
.hanji input[type=date]::-webkit-date-and-time-value, .hanji input[type=time]::-webkit-date-and-time-value { text-align: left; margin: 0; }
.hanji input[type=date]::-webkit-calendar-picker-indicator, .hanji input[type=time]::-webkit-calendar-picker-indicator { opacity: .55; }
.time-wrap { position: relative; }
.time-wrap .ph { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); margin-top: 3px; color: #a89a8a; font-size: 16px; pointer-events: none; }
.time-wrap.filled .ph, .time-wrap input:disabled + .ph { display: none; }

/* 생년월일·시간 선택 목록 (폰 기본 날짜 칸 대신) */
.pick3, .pick2 { display: grid; gap: 8px; margin-top: 6px; }
.pick3 { grid-template-columns: 1.35fr 1fr 1fr; }
.pick2 { grid-template-columns: 1.4fr 1fr; }
.hanji select { width: 100%; min-width: 0; font: inherit; font-size: 17px; color: #2a211c; background: #fffdf7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238a7a6c' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1.5px solid var(--hanji-line); border-radius: 12px; padding: 13px 30px 13px 12px; -webkit-appearance: none; appearance: none; outline: none; }
.hanji select:focus { border-color: var(--yeonji); box-shadow: 0 0 0 3px rgba(200,50,43,.15); }
.hanji select:disabled { opacity: .4; }
.hanji select:invalid, .hanji select option[value=""] { color: #a89a8a; }
.hanji select option { color: #2a211c; }


[hidden] { display: none !important; }
.partner-unknown { margin: -6px 0 20px; }
.partner { border-left: 3px solid var(--yeonji); padding-left: 12px; margin-left: -4px; }

/* 작은 폰에서 날짜 칸 글자가 화살표에 잘리지 않게 */
.pick3 select, .pick2 select { padding-right: 24px; background-position: right 9px center; }
@media (max-width: 360px) { .pick3 select, .pick2 select { font-size: 15.5px; padding-left: 10px; } }

.list-slide.on .scroll-list li:nth-child(5) { animation-delay: 2s; }
.list-slide.on .scroll-list li:nth-child(6) { animation-delay: 2.5s; }

/* 안전 안내: 상담 전화, 나이 */
.line .s.care { font-size: 15px; color: var(--gold-soft); margin-top: 10px; }
.line .s.care small { display: block; color: var(--hanji); font-size: 14px; margin-top: 2px; }
.care-card { margin: 14px 20px 0; padding: 12px 16px; border: 1px solid rgba(201,164,92,.45); border-radius: 12px; background: rgba(30,25,22,.8); color: var(--gold-soft); font-size: 14.5px; line-height: 1.7; }
.care-card b { color: var(--hanji); }
.age-note { display: block; margin-top: 8px; font-style: normal; font-size: 13.5px; color: #8a6a3a; background: #fbf3e2; border-radius: 8px; padding: 7px 10px; }
.age-note.stop { color: #fff; background: var(--yeonji); }

/* 안내 문구는 한 줄로 */
.hint { white-space: nowrap; }
/* 입력 칸 제목: 얼굴은 왼쪽 칸에 고정, 글씨는 오른쪽 칸에서 줄바꿈 (작은 폰에서 얼굴만 따로 떨어지지 않게) */
.say { display: grid; grid-template-columns: 34px 1fr; column-gap: 10px; align-items: center; }
.say::before { grid-row: 1 / span 2; align-self: start; }
.say small { grid-column: 2; flex-basis: auto; padding-left: 0; margin-top: 0; }

/* 밝은 그림(아랫목아씨 등)에서도 위쪽 진행 막대·이름이 보이게 */
.story .panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 110px; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(14,11,9,.55), transparent); }

/* ---------- 맛보기 풀이 (이야기 중간에 생일 먼저 받기) ---------- */
body.peeked .no-peek { display: none !important; }
body:not(.peeked) .if-peek { display: none !important; }
.peek-slide { display: grid; place-items: center; padding: 58px 14px 18px; overflow-y: auto; }
.peek-box { width: 100%; padding: 18px 16px 10px; }
.peek-box.nudge { animation: nudge .45s; }
.peek-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; padding-right: 30px; }
.peek-head img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; border: 2px solid var(--gold); flex: none; }
.peek-head p { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.5; }
.peek-head b { color: var(--yeonji); }
.peek-box .seg, .peek-box .pick3, .peek-box .pick2 { margin-top: 8px; }
.peek-box .check { margin-top: 8px; font-size: 14.5px; }
.peek-box .err { display: block; margin-top: 8px; }
.peek-box .cta { margin-top: 12px; font-size: 17px; padding: 15px; }
.peek-safe { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: #8a7a6c; }
.peek-later { display: block; margin: 0 auto; padding: 8px 12px; font: inherit; font-size: 14px; color: #8a7a6c; background: none; border: 0; cursor: pointer; }
.peek-slide.on .peek-box { animation: rise .7s both; }

.peek-chart { padding-top: clamp(64px, 13vh, 130px); }
.pc-box { margin: 0 18px; text-align: center; }
.pc-kicker { font-family: var(--round); font-size: 12.5px; font-weight: 700; letter-spacing: .3em; color: var(--gold); }
.pc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.pc-col { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; border: 1px solid rgba(201,164,92,.3); border-radius: 12px; background: rgba(30,25,22,.75); }
.pc-col small { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.pc-col b { font-family: var(--display); font-size: clamp(30px, 10.5vw, 42px); line-height: 1.2; font-weight: 400; }
.pc-col.me { border-color: var(--gold); box-shadow: 0 0 26px rgba(201,164,92,.28); }
.pc-col.me small { color: var(--gold-soft); }
.pc-col .unk { color: #5a4f46; }
.wx-w { color: #86c27f; } .wx-f { color: #ec6e62; } .wx-e { color: #d8b46c; } .wx-m { color: #e3e6e8; } .wx-a { color: #79aeea; }
.pc-wx { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pc-wx span { font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid currentColor; background: rgba(255,255,255,.04); }
.pc-wx span.zero { opacity: .45; }
.pc-wx i { font-style: normal; margin-right: 4px; }
.pc-bal { margin: 12px 0 0; font-family: var(--serif); font-size: 16px; line-height: 1.6; color: var(--hanji); }
.pc-bal b { color: #e6b36a; }
.pc-help { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.pc-help b { color: var(--gold-soft); font-weight: 700; }
@media (max-height: 700px) { .pc-help { display: none; } .peek-chart { padding-top: 58px; } }
.peek-chart.on .pc-col { animation: rise .6s both; }
.peek-chart.on .pc-col:nth-child(2) { animation-delay: .15s; }
.peek-chart.on .pc-col:nth-child(3) { animation-delay: .3s; }
.peek-chart.on .pc-col:nth-child(4) { animation-delay: .45s; }
.peek-chart.on .pc-wx, .peek-chart.on .pc-bal { animation: rise .6s .8s both; }
.peek-chart.on .line .s { animation: rise .7s 1.3s both; }
.peek-chart.on .line .s ~ .s { animation-delay: 2.1s; }
@media (prefers-reduced-motion: reduce) { .peek-chart .pc-col, .peek-chart .pc-wx, .peek-chart .pc-bal, .peek-chart .line .s { animation: none !important; } }
.prefill-note { margin: -6px 0 18px; padding: 10px 12px; font-size: 14px; line-height: 1.5; border-radius: 10px; background: rgba(201,164,92,.18); color: #5a4630; }

/* 미리보기 목록 머리말 */
.list-slide { align-content: center; gap: 14px; }
.list-kicker { margin: 0; font-family: var(--round); font-size: 12.5px; font-weight: 700; letter-spacing: .3em; color: var(--gold); text-align: center; }
.list-kicker::before, .list-kicker::after { content: ""; display: inline-block; width: 22px; height: 1px; background: var(--gold); opacity: .6; vertical-align: middle; margin: 0 10px; }
.list-slide.on .list-kicker { animation: rise .6s both; }
.list-slide .scroll-list li { line-height: 1.55; }
