:root {
  --bg: #1a0d0e;
  --bg2: #24131400;
  --panel: #2a1517;
  --line: #4a2a2c;
  --ink: #f3e6dc;
  --ink2: #c9b1a6;
  --ink3: #8f746b;
  --rose: #d9958a;
  --rose2: #f0c2b5;
  --gold: #e6b77a;
  --paper: #efe3cf;
  --paper-ink: #3a2620;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --script: 'Great Vibes', 'Snell Roundhand', cursive;
  --sans: Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: var(--serif); font-size: 17px; -webkit-font-smoothing: antialiased; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; padding-bottom: 40px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--ink3); }
.sans { font-family: var(--sans); }

/* ── Header / hero ── */
.home-hero { position: relative; height: 230px; overflow: hidden; border-radius: 0 0 22px 22px; background: radial-gradient(120% 80% at 80% 60%, #8a4a2c 0%, #4a1f1c 45%, #1a0d0e 100%); }
.home-hero img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.home-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(26,13,14,.85) 0%, rgba(26,13,14,.2) 70%), linear-gradient(0deg, var(--bg) 0%, transparent 40%); }
.brand { position: absolute; left: 22px; top: 54px; z-index: 2; }
.logo { font-family: var(--script); font-size: 54px; line-height: 1; color: var(--ink); text-shadow: 0 2px 18px rgba(0,0,0,.4); }
.tagline { margin-top: 8px; font-size: 16px; color: var(--ink2); line-height: 1.3; }
.write-fab { position: absolute; right: 18px; top: 64px; z-index: 3; width: 48px; height: 48px; border-radius: 50%; background: var(--rose); color: #2a1416; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(217,149,138,.35); }
.write-fab svg { width: 22px; height: 22px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 16px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink2); font-size: 15px; }
.chip.on { background: var(--paper); color: var(--paper-ink); border-color: var(--paper); }

/* ── Feed ── */
.feed { list-style: none; margin: 0; padding: 4px 16px; }
.item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid #ffffff10; }
.thumb { flex: none; width: 104px; height: 92px; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #5a2a26, #2a1517); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-body { flex: 1; min-width: 0; }
.meta { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 11px; color: var(--ink3); }
.meta .when { margin-left: auto; }
.tag { padding: 2px 9px; border-radius: 999px; background: #ffffff14; color: var(--rose2); font-size: 11px; }
.item h3 { margin: 6px 0 8px; font-weight: 500; font-size: 18px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.stats { display: flex; gap: 16px; font-family: var(--sans); font-size: 12px; color: var(--ink2); }
.stats span { display: inline-flex; align-items: center; gap: 5px; }
.heart { color: var(--rose); }
.empty { text-align: center; padding: 50px 20px; color: var(--ink3); }
.pending { opacity: .8; }

/* ── Top bar ── */
.bar { display: flex; align-items: center; gap: 10px; padding: 16px; position: sticky; top: 0; z-index: 5; background: linear-gradient(var(--bg) 70%, transparent); }
.bar h1 { flex: 1; margin: 0; font-weight: 500; font-size: 22px; text-align: center; }
.back { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.back svg { width: 20px; }
.bar .spacer { width: 36px; }

/* ── Write ── */
.write { padding: 0 20px; }
.write .intro { font-size: 30px; line-height: 1.15; margin: 8px 0 6px; font-weight: 500; }
.write .sub { color: var(--ink2); margin: 0 0 18px; }
.letter { position: relative; background: linear-gradient(180deg, #f4e9d8, #e9dbc4); color: var(--paper-ink); border-radius: 14px; padding: 18px; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.letter textarea { width: 100%; min-height: 220px; border: 0; background: repeating-linear-gradient(transparent 0 31px, #c9b49a66 31px 32px); line-height: 32px; font: 19px/32px var(--serif); color: var(--paper-ink); resize: vertical; outline: none; }
.letter .count { font-family: var(--sans); font-size: 11px; text-align: right; color: #8b7466; }
.label { margin: 22px 0 10px; font-size: 15px; color: var(--ink2); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg button { padding: 12px 6px; border-radius: 12px; border: 1px solid var(--line); font-size: 16px; color: var(--ink2); }
.seg button.on { border-color: var(--rose); color: var(--ink); background: #d9958a22; }
.hint { font-family: var(--sans); font-size: 12px; color: var(--ink3); margin-top: 8px; line-height: 1.5; }
.primary { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin-top: 24px; padding: 16px; border-radius: 999px; background: linear-gradient(90deg, #f0c9b7, #d9958a); color: #2a1416; font-size: 19px; font-weight: 600; }
.primary:disabled { opacity: .5; }
.err { color: #ffb4a8; font-family: var(--sans); font-size: 13px; margin-top: 10px; }

/* ── Working ── */
.working { padding: 70px 30px; text-align: center; }
.candle { width: 14px; height: 40px; margin: 0 auto 26px; border-radius: 4px; background: var(--paper); position: relative; }
.candle::before { content: ''; position: absolute; left: 50%; top: -22px; width: 12px; height: 20px; margin-left: -6px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(#fff6c8, #f2a64a 60%, transparent 70%); animation: flick 1.2s infinite alternate; }
@keyframes flick { from { transform: scale(1) rotate(-3deg); } to { transform: scale(1.12) rotate(3deg); } }
.working h2 { font-weight: 500; font-size: 26px; margin: 0 0 10px; }
.steps { list-style: none; padding: 0; margin: 20px auto; max-width: 260px; text-align: left; font-family: var(--sans); font-size: 13px; color: var(--ink3); }
.steps li { padding: 6px 0; }
.steps li.now { color: var(--rose2); }
.steps li.done { color: var(--ink2); }

/* ── Post detail ── */
.hero { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #5a2a26, #2a1517); }
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero .bar { position: absolute; inset: 0 0 auto; background: none; }
.hero .back { background: #0006; }
.post-head { padding: 16px 20px 6px; }
.byline { display: flex; align-items: center; gap: 10px; font-family: var(--sans); font-size: 13px; color: var(--ink2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #ffffff14; color: var(--rose2); font-family: var(--serif); font-size: 18px; flex: none; overflow: hidden; }
.byline .right { margin-left: auto; display: flex; gap: 12px; }
.post-head h2 { font-size: 27px; line-height: 1.2; font-weight: 500; margin: 14px 0 10px; }
.post-head p { color: var(--ink2); margin: 0; line-height: 1.45; }
.section { display: flex; justify-content: space-between; align-items: baseline; padding: 22px 20px 6px; border-top: 1px solid #ffffff10; margin-top: 18px; }
.section h4 { margin: 0; font-weight: 500; font-size: 18px; }
.section span { font-family: var(--sans); font-size: 12px; color: var(--ink3); }
.expr { display: flex; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #ffffff0d; }
.expr .face { width: 46px; height: 46px; font-size: 20px; }
.expr-body { flex: 1; min-width: 0; }
.lang { font-family: var(--sans); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--rose); }
.lang b { color: var(--ink3); font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 11px; margin-left: 6px; }
.orig { font-size: 21px; font-style: italic; font-weight: 500; line-height: 1.25; margin: 4px 0; }
.roman { font-family: var(--sans); font-size: 11px; color: var(--ink3); }
.mean { font-family: var(--sans); font-size: 13px; color: var(--ink2); margin-top: 4px; }
.expr-side { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.play { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #ffffff40; display: grid; place-items: center; }
.play svg { width: 16px; }
.play.on { background: var(--rose); color: #2a1416; border-color: var(--rose); }
.mini { font-family: var(--sans); font-size: 12px; color: var(--ink2); display: inline-flex; align-items: center; gap: 4px; }
.mini.on { color: var(--rose); }
.sticky-cta { position: sticky; bottom: 14px; padding: 0 16px; margin-top: 18px; }
.sticky-cta .primary { margin: 0; justify-content: space-between; padding: 15px 24px; background: linear-gradient(90deg, #6b3236, #8a4a4a); color: var(--ink); box-shadow: 0 10px 30px rgba(0,0,0,.5); }

/* ── Expression detail ── */
.curator { text-align: center; padding: 6px 24px 0; }
.curator .face { width: 120px; height: 120px; margin: 0 auto; font-size: 54px; border: 2px solid #d9958a55; }
.curator .name { font-size: 28px; margin: 12px 0 0; }
.curator .role { font-family: var(--sans); font-size: 12px; color: var(--ink3); }
.quote { margin: 22px 20px 0; padding: 22px; border-radius: 18px; background: linear-gradient(180deg, #2f191b, #241214); border: 1px solid #ffffff12; text-align: center; }
.quote .orig { font-size: 28px; }
.quote .mean { font-size: 15px; margin-top: 10px; }
.big-play { margin: 18px auto 0; display: flex; align-items: center; gap: 10px; padding: 11px 22px; border-radius: 999px; background: var(--rose); color: #2a1416; font-size: 17px; font-weight: 600; }
.big-play svg { width: 16px; }
.explain { padding: 20px 22px 0; line-height: 1.6; color: var(--ink2); font-size: 18px; }
.explain h5 { margin: 0 0 6px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--rose); font-family: var(--sans); font-weight: 500; }
.actions { display: flex; gap: 10px; padding: 18px 20px 0; }
.ghost { flex: 1; padding: 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 16px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.ghost.on { color: var(--rose); border-color: var(--rose); }
.comments { padding: 4px 20px; }
.cmt { padding: 14px 0; border-bottom: 1px solid #ffffff0d; }
.cmt .who { font-family: var(--sans); font-size: 12px; color: var(--ink3); }
.cmt .txt { margin-top: 4px; line-height: 1.45; }
.reply { margin: 10px 0 0 18px; padding: 10px 12px; border-left: 2px solid var(--rose); background: #ffffff08; border-radius: 0 10px 10px 0; }
.reply .who { color: var(--rose2); }
.composer { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid #ffffff10; }
.composer input { flex: 1; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); background: #ffffff08; color: var(--ink); font: 16px var(--serif); outline: none; }
.composer button { padding: 0 18px; border-radius: 999px; background: var(--rose); color: #2a1416; font-weight: 600; }

/* ── Card ── */
.stage { padding: 6px 22px 0; }
.postcard { position: relative; background: #e9dcc5; color: var(--paper-ink); padding: 16px 16px 20px; border-radius: 4px; box-shadow: 0 2px 0 #d6c4a5, 0 22px 50px rgba(0,0,0,.55); transform: rotate(-1deg); }
.postcard::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 10%, #ffffff40, transparent 50%), radial-gradient(circle at 90% 100%, #a0806030, transparent 60%); pointer-events: none; }
.postcard .photo { aspect-ratio: 4 / 3; overflow: hidden; border: 6px solid #f6efe2; box-shadow: 0 2px 6px #0003; background: #5a2a26; }
.postcard .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.postcard .orig { text-align: center; font-size: 26px; margin: 18px 6px 6px; color: var(--paper-ink); }
.postcard .mean { text-align: center; font-family: var(--serif); font-style: italic; font-size: 16px; color: #6b5146; }
.postcard .msg { text-align: center; font-family: var(--script); font-size: 26px; color: #7a3b36; margin-top: 12px; }
.postcard .langname { text-align: center; font-family: var(--sans); font-size: 11px; letter-spacing: .25em; text-transform: uppercase; margin-top: 14px; color: #8b6f5e; }
.postcard .stamp { position: absolute; right: 16px; bottom: 14px; width: 54px; height: 54px; border-radius: 50%; border: 1.5px dashed #9b7a6655; display: grid; place-items: center; font-family: var(--script); font-size: 18px; color: #9b7a6688; transform: rotate(-14deg); }
.postcard.t-letter { background: #f3ead9; transform: rotate(.6deg); }
.postcard.t-letter .photo { border: 0; border-radius: 8px; }
.postcard.t-night { background: #2c1a1b; color: var(--ink); }
.postcard.t-night .orig, .postcard.t-night .msg { color: var(--rose2); }
.postcard.t-night .mean, .postcard.t-night .langname { color: var(--ink2); }
.postcard.t-night .photo { border-color: #3d2526; }
.templates { display: flex; gap: 10px; padding: 22px 22px 0; }
.templates button { flex: 1; padding: 10px 4px; border-radius: 10px; border: 1px solid var(--line); font-size: 14px; color: var(--ink2); }
.templates button.on { border-color: var(--rose); color: var(--ink); }
.field { padding: 0 22px; }
.field textarea { width: 100%; min-height: 80px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: #ffffff08; color: var(--ink); font: 17px var(--serif); outline: none; resize: none; }
.row2 { display: flex; gap: 10px; padding: 0 22px; }
.row2 .primary { margin-top: 16px; font-size: 16px; }
.row2 .ghost { margin-top: 16px; }
.shared-head { text-align: center; padding: 30px 20px 10px; }
.shared-head .logo { font-size: 40px; position: static; }
.shared-head p { color: var(--ink2); margin: 6px 0 0; }
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); background: var(--paper); color: var(--paper-ink); padding: 10px 18px; border-radius: 999px; font-family: var(--sans); font-size: 13px; z-index: 50; }

/* ── Gate ── */
.gate { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 30px; text-align: center; }
.gate .logo { font-size: 64px; }
.gate input { margin-top: 26px; padding: 14px 18px; border-radius: 999px; border: 1px solid var(--line); background: #ffffff08; color: var(--ink); font: 17px var(--sans); text-align: center; outline: none; }
.gate label { margin-top: 16px; font-family: var(--sans); font-size: 13px; color: var(--ink2); display: flex; gap: 8px; justify-content: center; align-items: center; }

/* ── Sign-in sheet ── */
.sheet { position: fixed; inset: 0; z-index: 40; background: #0009; display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 480px; background: var(--panel); border-radius: 22px 22px 0 0; padding: 26px 24px calc(20px + env(safe-area-inset-bottom)); text-align: center; }
.sheet-card p { color: var(--ink2); line-height: 1.45; }
.sheet-card .keep { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 14px 0 0; font-family: var(--sans); font-size: 13px; color: var(--ink2); }
.sheet-card .ghost { width: 100%; margin-top: 10px; }
.account { text-align: center; font-family: var(--sans); font-size: 12px; color: var(--ink3); margin-top: 26px; }
.account button { color: var(--rose); text-decoration: underline; font-size: 12px; }

/* ── 받은 카드: 듣고 나서 의미가 드러난다 ── */
.stage .postcard .mean, .explain.veil-target { transition: opacity 1.6s ease, filter 1.6s ease, transform 1.6s ease; }
.stage.veiled .postcard .mean { opacity: 0; filter: blur(6px); transform: translateY(4px); }
.stage.veiled ~ .explain.veil-target { opacity: 0; filter: blur(4px); pointer-events: none; }
.stage.revealed .postcard .mean { animation: glow 2.4s ease; }
@keyframes glow { 0% { text-shadow: 0 0 0 transparent; } 40% { text-shadow: 0 0 14px #e6b77a99; } 100% { text-shadow: 0 0 0 transparent; } }
.reveal-link { display: block; margin: 14px auto 0; font-family: var(--sans); font-size: 12px; color: var(--ink3); text-decoration: underline; }

/* ── 배경음악 켜고 끄기 ── */
.bgm-toggle { position: fixed; right: max(16px, calc(50% - 224px)); top: calc(16px + env(safe-area-inset-top)); z-index: 30; width: 36px; height: 36px; border-radius: 50%; background: #2a1517cc; border: 1px solid var(--line); color: var(--rose2); font-size: 17px; backdrop-filter: blur(6px); }
.bgm-toggle.off { color: var(--ink3); }
.bgm-toggle svg { width: 19px; height: 19px; display: block; margin: auto; }

/* ── 받은 카드: 봉투 · 두 장짜리 카드 · 타이핑 · 금빛 먼지 ── */
.hidden { display: none !important; }
.dust { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.dust i { position: absolute; bottom: -10px; width: 3px; height: 3px; border-radius: 50%; background: #f3d39a; box-shadow: 0 0 8px 2px #e6b77a66; opacity: 0; animation: float linear infinite; }
@keyframes float { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: .7; } 85% { opacity: .5; } 100% { transform: translate(var(--x), -105vh); opacity: 0; } }
.shared-head, .envelope-wrap, .stage, .quote, .explain, .after { position: relative; z-index: 1; }

.envelope-wrap { text-align: center; padding: 50px 0 20px; }
.envelope { position: relative; width: 300px; max-width: 82vw; aspect-ratio: 3 / 2; background: linear-gradient(160deg, #e9dcc5, #d6c3a3); border-radius: 6px; box-shadow: 0 24px 50px rgba(0,0,0,.55); perspective: 900px; animation: breathe 3.2s ease-in-out infinite; }
.envelope .pocket { position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(to top right, #d9c7a7 50%, transparent 50%) left / 50% 100% no-repeat, linear-gradient(to top left, #d2bf9e 50%, transparent 50%) right / 50% 100% no-repeat; }
.envelope .flap { position: absolute; left: 0; right: 0; top: 0; height: 58%; background: linear-gradient(180deg, #cdb894, #e2d3b8); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform .8s cubic-bezier(.4,.1,.3,1); z-index: 2; }
.envelope .seal { position: absolute; left: 50%; top: 58%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; z-index: 3; display: grid; place-items: center; font-family: var(--script); font-size: 22px; color: #f3d9cf; background: radial-gradient(circle at 35% 30%, #a3443f, #6d1f22 70%); box-shadow: 0 3px 8px #0006, inset 0 0 0 4px #7d2a2a; transition: opacity .4s, transform .5s; }
.envelope-wrap .tap { margin-top: 18px; font-family: var(--sans); font-size: 13px; color: var(--ink2); letter-spacing: .08em; animation: pulse 2s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-4px) rotate(-.6deg); } }
@keyframes pulse { 50% { opacity: .45; } }
.envelope-wrap.opening .envelope { animation: none; }
.envelope-wrap.opening .seal { opacity: 0; transform: scale(1.4); }
.envelope-wrap.opening .flap { transform: rotateX(180deg); }
.envelope-wrap.opening { animation: sink .9s .35s ease forwards; }
@keyframes sink { to { opacity: 0; transform: translateY(40px); } }

.stage.rise { animation: rise 1.3s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(70px) scale(.94); } to { opacity: 1; transform: none; } }
.card3d { position: relative; transform-style: preserve-3d; transition: transform 1.1s cubic-bezier(.5,.1,.25,1); cursor: pointer; }
.card3d.flipped { transform: rotateY(180deg); }
.card3d .face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card3d .verso { position: absolute; inset: 0; transform: rotateY(180deg); display: flex; flex-direction: column; padding: 26px 24px; background-image: repeating-linear-gradient(transparent 0 33px, #b9a07f44 33px 34px); background-color: #efe4cf; }
.card3d .verso::after { content: ''; position: absolute; top: 90px; bottom: 30px; left: 58%; border-left: 1px solid #b9a07f55; display: none; }
.postmark { align-self: flex-end; font-family: var(--sans); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: #9b7a66; border: 1.5px solid #9b7a6677; border-radius: 50%; padding: 16px 10px; transform: rotate(-12deg); margin-bottom: 8px; }
.verso .dear { font-family: var(--script); font-size: 30px; color: #7a3b36; }
.verso .typed { margin-top: 10px; font-family: 'Courier Prime', 'American Typewriter', Courier, monospace; font-size: 19px; line-height: 34px; color: #3a2620; min-height: 68px; }
.typed.typing::after { content: '▍'; margin-left: 1px; animation: caret .8s steps(1) infinite; color: #7a3b36; }
@keyframes caret { 50% { opacity: 0; } }
.verso .hand { margin-top: 16px; font-family: var(--script); font-size: 30px; line-height: 1.2; color: #7a3b36; clip-path: inset(0 100% 0 0); }
.verso .hand.write { animation: write 1.8s ease-out forwards; }
@keyframes write { to { clip-path: inset(0 0 0 0); } }
.verso .sign { margin-top: auto; align-self: flex-end; font-family: var(--serif); font-style: italic; font-size: 16px; color: #6b5146; opacity: 0; transition: opacity 1.2s; padding-right: 64px; }
.verso .sign.show { opacity: 1; }
.postcard.t-night.verso { background-color: #2c1a1b; background-image: repeating-linear-gradient(transparent 0 33px, #ffffff14 33px 34px); }
.postcard.t-night .typed { color: var(--ink); }
.postcard.t-night .dear, .postcard.t-night .hand { color: var(--rose2); }
.stage.revealed ~ .after { animation: rise 1s ease; }
@media (prefers-reduced-motion: reduce) { .dust, .envelope-wrap { display: none; } .card3d { transition: none; } }

/* ── 큐레이터 초상화 ── */
.avatar.face { position: relative; }
.avatar.face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar.face.mid { width: 72px; height: 72px; font-size: 30px; }
.curator .face { overflow: visible; }
.curator .face img { box-shadow: 0 10px 30px #0008; }
.ai-badge { position: absolute; right: 2px; bottom: 6px; z-index: 2; padding: 2px 7px; border-radius: 999px; background: #1a0d0ecc; border: 1px solid #ffffff30; font-family: var(--sans); font-size: 10px; letter-spacing: .08em; color: var(--ink2); }

/* ── 받은 카드 v2: 카드만 · 예쁜 편지지 · 마지막 장 ── */
body.cardmode #app { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 24px 0; }
.roman-front { text-align: center; font-family: var(--serif); font-style: italic; font-size: 15px; color: #8b6f5e; margin: 2px 10px 0; letter-spacing: .02em; }
.stage.fade-out { animation: fadeAway 1s ease forwards; }
@keyframes fadeAway { to { opacity: 0; transform: scale(.97); filter: blur(2px); } }

.card3d .letterpaper { position: absolute; inset: 0; transform: rotateY(180deg); display: flex; flex-direction: column; padding: 34px 30px 30px; border-radius: 3px; color: #3f2a22;
  background:
    radial-gradient(120% 80% at 0% 0%, #fffaf0 0%, transparent 55%),
    radial-gradient(120% 90% at 100% 100%, #ead7bd 0%, transparent 60%),
    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%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .32 0 0 0 0 .22 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    #f6ecdc;
  box-shadow: 0 2px 0 #e0cfb3, 0 26px 60px rgba(0,0,0,.55), inset 0 0 40px #c9a98322; }
.letterpaper .frame { position: absolute; inset: 12px; border: 1px solid #c49a8a88; outline: 1px solid #c49a8a44; outline-offset: 4px; border-radius: 2px; pointer-events: none; }
.letterpaper .sprig { position: absolute; left: 14px; bottom: 14px; width: 96px; color: #b27c70; opacity: .55; transform: rotate(-6deg); }
.letterpaper .postmark { align-self: flex-end; font-family: var(--sans); font-size: 9px; letter-spacing: .22em; text-transform: uppercase; color: #a07d6a; border: 1.5px solid #a07d6a66; border-radius: 50%; padding: 15px 9px; transform: rotate(-12deg); }
.letterpaper .dear { font-family: var(--script); font-size: 34px; color: #8a3e3a; margin-top: 4px; }
.letterpaper .typed { margin-top: 12px; font-family: 'Courier Prime', 'American Typewriter', Courier, monospace; font-size: 18px; line-height: 1.75; color: #3f2a22; min-height: 64px; }
.letterpaper .hand { margin-top: 18px; font-family: var(--script); font-size: 31px; line-height: 1.2; color: #8a3e3a; clip-path: inset(0 100% 0 0); }
.letterpaper .hand.write { animation: write 1.3s ease-out forwards; }
.letterpaper .sign { margin-top: auto; align-self: flex-end; font-family: var(--serif); font-style: italic; font-size: 16px; color: #7a5a4c; opacity: 0; transition: opacity 1s; }
.letterpaper .sign.show { opacity: 1; }

.finale { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 40px 20px; animation: finaleIn 2.2s ease both; position: relative; z-index: 1; }
.finale .logo { font-size: 64px; }
.finale .finale-tag { color: var(--ink2); font-size: 18px; }
.finale .url { margin-top: 18px; font-family: var(--sans); font-size: 13px; letter-spacing: .14em; color: var(--rose2); }
@keyframes finaleIn { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }

.finale-home { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.finale-actions { display: flex; gap: 10px; width: 100%; max-width: 340px; margin-top: 34px; opacity: 0; animation: finaleIn 1.4s 1.6s ease forwards; }
.finale-actions .ghost, .finale-actions .primary { flex: 1; margin: 0; padding: 13px; font-size: 16px; }

/* 편지 본문도 "Dear you," 와 같은 필기체 (사용자) */
.card3d .letterpaper .typed { font-family: var(--script); font-size: 31px; line-height: 1.3; color: #4a2c24; margin-top: 8px; }
.card3d .letterpaper .typed.typing::after { content: ''; display: inline-block; width: 2px; height: .8em; margin-left: 2px; background: #8a3e3a; vertical-align: -0.05em; animation: caret .8s steps(1) infinite; }
.card3d .letterpaper .hand { font-size: 29px; }
