/* ============================================================
   생일 편지 & 케이크 — style.css
   ============================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body[data-ui="dark"] {
  --bg: #100e12; --bg2: #17131a; --card: #1c1720; --card2: #241d2a;
  --ink: #f2e9f0; --ink-dim: #a99aae; --ink-mute: #7d7085;
  --line: rgba(255,255,255,.09); --line2: rgba(255,255,255,.16);
  --pink: #ff5d9e; --pink2: #ff8fbb; --gold: #ffcf7a;
  --shadow: 0 18px 40px rgba(0,0,0,.45);
  --field: rgba(255,255,255,.055);
  --pv-bg: radial-gradient(120% 90% at 50% 0%, #2b1f2d 0%, #18121b 55%, #100d12 100%);
}
body[data-ui="light"] {
  --bg: #f6efe7; --bg2: #fffaf4; --card: #fffdfa; --card2: #fdf3ec;
  --ink: #33272c; --ink-dim: #8b7a80; --ink-mute: #a7969c;
  --line: rgba(90,50,60,.12); --line2: rgba(90,50,60,.22);
  --pink: #e8508c; --pink2: #ff7fae; --gold: #d99b45;
  --shadow: 0 16px 36px rgba(140,100,90,.14);
  --field: rgba(255,255,255,.8);
  --pv-bg: radial-gradient(120% 90% at 50% 0%, #fff9f2 0%, #f7eade 60%, #f0e0d3 100%);
}

/* ---------- 상단 바 ---------- */
.bar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-ico { font-size: 20px; line-height: 1; }
.brand-t { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.bar-r { display: flex; align-items: center; gap: 10px; }
.bar-note { font-size: 11px; color: var(--ink-mute); }
.icon-btn {
  border: 1px solid var(--line2); background: var(--field); color: var(--ink);
  width: 34px; height: 34px; border-radius: 11px; font-size: 14px; cursor: pointer;
  display: grid; place-items: center; transition: .16s;
}
.icon-btn:hover { border-color: var(--pink); }

/* ---------- 레이아웃 ---------- */
.studio { padding-bottom: 90px; }
.wrap {
  max-width: 1160px; margin: 0 auto; padding: 22px 20px 40px;
  display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); gap: 24px;
  align-items: start;
}
.pv { position: sticky; top: 78px; }
.pv-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.pv-tabs button {
  flex: 0 0 auto; border: 1px solid var(--line); background: transparent; color: var(--ink-dim);
  padding: 7px 15px; border-radius: 999px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: .18s;
}
.pv-tabs button.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.pv-body {
  background: var(--pv-bg); border: 1px solid var(--line); border-radius: 22px;
  padding: 6px; box-shadow: var(--shadow); overflow: hidden;
}
.cakebox { aspect-ratio: 380 / 322; width: 100%; }
.cakebox svg { width: 100%; height: 100%; display: block; }
.letterbox { padding: 14px; max-height: 62vh; overflow: auto; }
.letterbox .paper { max-width: none; }
.pv-cap { margin: 12px 2px 0; font-size: 11.5px; color: var(--ink-mute); text-align: center; line-height: 1.6; }
.pv-steps { list-style: none; margin: 16px 0 0; padding: 14px 16px; border: 1px dashed var(--line2); border-radius: 16px; display: flex; flex-direction: column; gap: 9px; }
.pv-steps li { display: flex; align-items: baseline; gap: 9px; font-size: 11.5px; color: var(--ink-dim); }
.pv-steps b { font-size: 9.5px; font-weight: 800; letter-spacing: .06em; color: var(--pink); flex: 0 0 auto; }
@media (max-width: 900px) { .pv-steps { display: none; } }

/* ---------- 카드 ---------- */
.panel { display: flex; flex-direction: column; gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 20px 20px 22px; box-shadow: 0 8px 22px rgba(0,0,0,.06);
}
body[data-ui="dark"] .card { box-shadow: 0 10px 26px rgba(0,0,0,.22); }
.card-h {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 16px; font-size: 15.5px; font-weight: 800; letter-spacing: -.01em;
}
.card-h i {
  font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .04em;
  background: var(--pink); color: #fff; padding: 3px 7px; border-radius: 7px;
}
.card-h small { font-size: 11px; font-weight: 500; color: var(--ink-mute); margin-left: auto; }

.field { margin-top: 16px; }
.field:first-of-type { margin-top: 0; }
.lab { font-size: 12px; font-weight: 700; color: var(--ink-dim); margin-bottom: 9px; letter-spacing: .01em; }
.lab em { font-style: normal; font-weight: 400; color: var(--ink-mute); font-size: 11px; margin-left: 4px; }

/* ---------- 프리셋 ---------- */
.presets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.preset {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 4px 9px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card2); color: var(--ink);
  font-family: inherit; transition: .18s;
}
.preset:hover { border-color: var(--pink2); transform: translateY(-1px); }
.preset.on { border-color: var(--pink); background: color-mix(in srgb, var(--pink) 14%, var(--card2)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pink) 22%, transparent); }
.ps-emoji { font-size: 21px; line-height: 1.2; }
.ps-name { font-size: 11px; font-weight: 600; text-align: center; line-height: 1.3; color: var(--ink-dim); }
.preset.on .ps-name { color: var(--ink); }

/* ---------- 칩 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line2); background: var(--field); color: var(--ink-dim);
  padding: 8px 14px; border-radius: 11px; font-size: 12.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: .16s;
}
.chip:hover { border-color: var(--pink2); color: var(--ink); }
.chip.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.font-chip { display: flex; align-items: center; gap: 7px; padding: 7px 13px 7px 10px; }
.font-chip b { font-size: 15px; font-weight: 600; }
.font-chip span { font-size: 11.5px; }

/* ---------- 색 동그라미 ---------- */
.swatches { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.sw {
  width: 34px; height: 34px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid rgba(0,0,0,.12); background: none; position: relative; transition: .16s;
}
.sw span {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  background: var(--c); box-shadow: inset 0 -2px 5px rgba(0,0,0,.14), inset 0 2px 4px rgba(255,255,255,.5);
}
.sw.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--pink); }
.sw.sm { width: 26px; height: 26px; }
.sw.custom { display: grid; place-items: center; border: 1px dashed var(--line2); color: var(--ink-dim); font-size: 15px; overflow: hidden; }
.sw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ---------- 토핑 토글 ---------- */
.toggles { display: flex; flex-wrap: wrap; gap: 7px; }
.tgl {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line2); background: var(--field); color: var(--ink-dim);
  padding: 8px 12px; border-radius: 11px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: .16s;
}
.tgl span { font-size: 14px; }
.tgl:hover { border-color: var(--pink2); color: var(--ink); }
.tgl.on { background: color-mix(in srgb, var(--pink) 16%, transparent); border-color: var(--pink); color: var(--ink); }

/* ---------- 입력 ---------- */
.field-l { display: block; margin-top: 13px; }
.field-l:first-child { margin-top: 0; }
.field-l > span { display: block; font-size: 12px; font-weight: 700; color: var(--ink-dim); margin-bottom: 7px; }
.inp {
  width: 100%; border: 1px solid var(--line2); background: var(--field); color: var(--ink);
  border-radius: 12px; padding: 11px 13px; font-size: 14px; font-family: inherit;
  transition: .16s; outline: none;
}
.inp::placeholder { color: var(--ink-mute); }
.inp:focus { border-color: var(--pink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pink) 18%, transparent); }
.inp.ta { resize: vertical; min-height: 130px; line-height: 1.8; }
.inp.sm { padding: 9px 12px; font-size: 13px; }
.input-wrap { position: relative; }
.input-wrap .counter { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 10.5px; color: var(--ink-mute); pointer-events: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.under { margin-top: 6px; font-size: 10.5px; color: var(--ink-mute); text-align: right; }
.hint { font-size: 11.5px; color: var(--ink-mute); line-height: 1.7; margin: 9px 0 0; }
.hint b { color: var(--pink); }
.hint.tip { margin-top: 14px; background: color-mix(in srgb, var(--pink) 8%, transparent); border-radius: 11px; padding: 10px 12px; }
.fmt { display: block; margin-top: 6px; font-size: 10.5px; color: var(--ink-mute); line-height: 1.6; }
.fmt b { color: var(--pink); }
.hint-i { font-size: 10.5px; color: var(--ink-mute); }

.inline-pick { display: flex; align-items: center; gap: 11px; margin-top: 11px; flex-wrap: wrap; }
.mini-lab { font-size: 11px; color: var(--ink-mute); font-weight: 600; }

.candle-row { display: flex; align-items: center; gap: 9px; margin-top: 11px; font-size: 12px; color: var(--ink-dim); }
.candle-row b { font-size: 15px; color: var(--ink); }
.candle-row input[type="range"] { flex: 1; accent-color: var(--pink); max-width: 240px; }
.candle-row .inp { max-width: 100px; }

/* ---------- 편지지 고르기 ---------- */
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.paper-chip {
  border: 1px solid var(--line); background: var(--card2); color: var(--ink);
  border-radius: 13px; padding: 7px 7px 9px; cursor: pointer; font-family: inherit;
  display: flex; flex-direction: column; gap: 5px; transition: .16s; text-align: left;
}
.paper-chip:hover { border-color: var(--pink2); transform: translateY(-1px); }
.paper-chip.on { border-color: var(--pink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pink) 25%, transparent); }
.pc-mini {
  position: relative; display: block; width: 100%; aspect-ratio: 3 / 3.6;
  border-radius: 6px; overflow: hidden; border: 1px solid rgba(0,0,0,.08);
  padding: 0 !important; transform: none !important;
}
.pc-mini i { position: absolute; left: 16%; height: 2px; border-radius: 2px; background: currentColor; opacity: .33; }
.pc-mini i:nth-child(1) { top: 26%; width: 52%; }
.pc-mini i:nth-child(2) { top: 40%; width: 68%; }
.pc-mini i:nth-child(3) { top: 54%; width: 44%; }
.pc-name { font-size: 10.5px; font-weight: 700; line-height: 1.25; }
.pc-tag { font-size: 9px; color: var(--ink-mute); line-height: 1.2; }

/* ---------- 사진 ---------- */
.photo-row { display: flex; gap: 14px; align-items: flex-start; }
.photo-thumb {
  width: 88px; height: 88px; border-radius: 14px; flex: 0 0 auto;
  border: 1px dashed var(--line2); background: var(--field);
  display: grid; place-items: center; color: var(--ink-mute); font-size: 24px; overflow: hidden;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-acts { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.photo-acts .ghost { width: auto; }

/* ---------- 버튼 ---------- */
.ghost {
  border: 1px solid var(--line2); background: var(--field); color: var(--ink);
  padding: 9px 15px; border-radius: 12px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: .16s;
}
.ghost:hover { border-color: var(--pink); }
.ghost.big { padding: 12px 18px; font-size: 13px; width: 100%; }
.primary {
  border: 0; background: linear-gradient(135deg, var(--pink), #ff7fb4);
  color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 13px; font-weight: 800;
  cursor: pointer; font-family: inherit; box-shadow: 0 8px 20px color-mix(in srgb, var(--pink) 32%, transparent);
  transition: .16s; white-space: nowrap;
}
.primary:hover { transform: translateY(-1px); }
.primary:active { transform: translateY(0); }
.btn-row { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- 잠금 ---------- */
.lock-box {
  background: color-mix(in srgb, var(--pink) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--pink) 26%, transparent);
  border-radius: 16px; padding: 14px 15px 16px; margin-bottom: 16px;
}
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; position: relative; }
.switch input { position: absolute; left: 0; top: 0; width: 100%; height: 100%; opacity: 0; margin: 0; cursor: pointer; }
.switch .sl {
  width: 42px; height: 24px; border-radius: 999px; background: var(--line2);
  position: relative; transition: .2s; flex: 0 0 auto;
}
.switch .sl::after {
  content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + .sl { background: var(--pink); }
.switch input:checked + .sl::after { transform: translateX(18px); }
.sw-t { font-size: 13px; font-weight: 800; }
.lock-fields { margin-top: 12px; transition: .2s; }
.lock-fields.off { opacity: .38; pointer-events: none; }
.link-row { display: flex; gap: 8px; }
.inp.link { font-size: 11.5px; color: var(--ink-dim); }
.under .warn, #lenNote.warn { color: var(--gold); font-size: 11px; }

.studio-foot {
  display: flex; gap: 8px; justify-content: center; flex-wrap: wrap;
  font-size: 11px; color: var(--ink-mute); padding: 18px 0 4px;
}

/* ---------- 모바일 하단 바 ---------- */
.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: none; gap: 9px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.mbar .ghost { flex: 1; }
.mbar .primary { flex: 1.2; }

/* ============================================================
   종이 (편지지) 14종
   ============================================================ */
.paper {
  position: relative; width: 100%; max-width: 560px; margin: 0 auto;
  border-radius: 12px; overflow: hidden; isolation: isolate;
  --p-ink: #3b2c28; --p-sub: #96807a; --p-accent: #c2748f;
  color: var(--p-ink); font-size: 16px; line-height: 1.95;
  box-shadow: 0 22px 44px rgba(60, 30, 40, .2), inset 0 1px 0 rgba(255,255,255,.45);
}
.p-in { position: relative; z-index: 3; padding: 38px 34px 30px; }
.p-texture {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.p-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .84em; color: var(--p-sub); margin-bottom: 20px; letter-spacing: .02em; }
.p-to { font-weight: 700; }
.p-date { font-size: .92em; }
.p-title { font-size: 1.5em; line-height: 1.42; margin: 10px 0 16px; font-weight: 700; letter-spacing: -.01em; word-break: keep-all; }
.p-body { font-size: 1em; line-height: 2; word-break: keep-all; overflow-wrap: anywhere; }
.p-body p { margin: 0 0 .5em; }
.p-body p.blank { height: .8em; margin: 0; }
.p-empty { color: var(--p-sub); font-style: italic; }
.p-sign { text-align: right; margin-top: 28px; font-size: 1.02em; }
.p-sign span { display: inline-block; border-bottom: 1px solid currentColor; padding: 0 4px 3px; opacity: .9; }
.p-photo { margin: 0 0 18px; border-radius: 8px; overflow: hidden; background: rgba(0,0,0,.06); }
.p-photo img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: cover; }
.p-photo-empty { aspect-ratio: 3/2; display: grid; place-items: center; color: rgba(0,0,0,.22); border: 1px dashed currentColor; font-size: 12px; }
.deco { pointer-events: none; }

/* 01 크림 종이 */
.p-cream { background: radial-gradient(120% 80% at 50% 0%, #fffdf8, #fdf5e8 55%, #f7ead6 100%); }
.p-cream .p-in::after { content: ''; position: absolute; inset: 12px; border: 1px dashed rgba(186,148,112,.45); border-radius: 8px; pointer-events: none; }

/* 02 빈티지 엽서 */
.p-postcard {
  background: linear-gradient(150deg, #f7ecd7, #efe0c3 58%, #e8d4af);
  box-shadow: 0 22px 40px rgba(90,60,30,.24), inset 0 0 0 1px rgba(150,110,70,.4);
}
.p-postcard .deco.stamp {
  position: absolute; z-index: 4; right: 18px; top: 16px; width: 58px; height: 70px;
  background: #fffdf5; border: 2px dashed #c8ac82; border-radius: 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transform: rotate(3deg); box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.p-postcard .stamp b { font-family: 'Playfair Display', serif; color: #b05a5a; font-size: 13px; letter-spacing: .06em; }
.p-postcard .stamp i { font-style: normal; font-size: 8px; color: #9a8a72; letter-spacing: .1em; }
.p-postcard .deco.postmark {
  position: absolute; right: 64px; top: 24px; width: 76px; height: 54px;
  border: 1.5px solid #b39d78; border-radius: 50%; transform: rotate(-12deg); opacity: .5; z-index: 4;
}
.p-postcard .deco.postmark::after { content: 'SEOUL 12.02'; position: absolute; left: 12px; top: 21px; font-size: 7px; color: #a08a64; letter-spacing: .06em; }
.p-postcard .p-in { padding-top: 46px; }
.p-postcard .p-head { padding-right: 92px; }
.p-postcard .p-title { color: #5a3f2a; }

/* 03 폴라로이드 */
.p-polaroid {
  background: linear-gradient(#fffdfb, #fffaf5); padding: 16px 16px 0;
  border-radius: 6px; color: #3d3330;
  box-shadow: 0 26px 46px rgba(80,50,40,.26), inset 0 0 0 1px rgba(0,0,0,.05);
}
.p-polaroid .p-in { padding: 16px 12px 34px; }
.p-polaroid .p-photo { margin-bottom: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.p-polaroid .p-head { font-family: 'Nanum Pen Script', cursive; font-size: 1.05em; color: #6b5a52; }
.p-polaroid .deco.tape {
  position: absolute; left: 50%; top: -10px; width: 104px; height: 26px; transform: translateX(-50%) rotate(-2deg);
  background: rgba(255, 214, 180, .72); border-left: 1px dashed rgba(255,255,255,.6); border-right: 1px dashed rgba(255,255,255,.6);
  z-index: 5; box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

/* 04 파스텔 케이크 패턴 */
.p-cakey {
  background-color: #ffe9f1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='62' height='62' viewBox='0 0 62 62'%3E%3Cg fill='none' stroke='%23ff9dc2' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M19 42h24v7a4 4 0 0 1-4 4H23a4 4 0 0 1-4-4z'/%3E%3Cpath d='M19 42c0-8 5-12 12-12s12 4 12 12'/%3E%3Cpath d='M31 30v-4'/%3E%3C/g%3E%3Ccircle cx='31' cy='23' r='2.4' fill='%23ff9dc0'/%3E%3C/svg%3E");
  background-size: 54px 54px;
}
.p-cakey .p-in {
  margin: 15px; background: rgba(255,255,255,.8); border-radius: 10px;
  box-shadow: 0 8px 20px rgba(220,140,175,.18); border: 1px solid rgba(255,200,220,.9);
  backdrop-filter: blur(2px);
}

/* 05 다크 블랙핑크 */
.p-blackpink {
  background: radial-gradient(120% 100% at 20% 0%, #2a1420, #140d13 55%, #0c080c);
  color: #f6ecf2; --p-sub: #b48aa0; --p-accent: #ff5d9e;
  box-shadow: 0 26px 50px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,93,158,.28), inset 0 0 80px rgba(255,93,158,.06);
}
.p-blackpink .p-title { color: #ff8fbb; text-shadow: 0 0 22px rgba(255,93,158,.45); }
.p-blackpink .p-in::after { content: ''; position: absolute; inset: 14px; border: 1px solid rgba(255,93,158,.22); border-radius: 10px; pointer-events: none; }
.p-blackpink .p-sign span { border-color: #ff5d9e; color: #ffb3d0; }
.p-blackpink .deco.glow-dot { position: absolute; right: -40px; top: -40px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(255,93,158,.35), transparent 70%); z-index: 1; }
.p-blackpink .p-empty { color: #a97e94; }

/* 06 Y2K 체커 */
.p-y2k {
  background-color: #fff;
  background-image: repeating-conic-gradient(from 0deg at 50% 50%, #ffd9e8 0deg 90deg, #ffffff 90deg 180deg);
  background-size: 36px 36px;
  color: #3a2b3a; --p-sub: #8b7289;
}
.p-y2k .p-in {
  margin: 22px; background: rgba(255,255,255,.8); border: 2px solid #ff9dc4; border-radius: 4px;
  box-shadow: 6px 6px 0 rgba(255,157,196,.9); backdrop-filter: blur(3px);
}
.p-y2k .p-title { font-weight: 900; letter-spacing: -.02em; color: #ff4f96; text-shadow: 2px 2px 0 #ffd166, 3px 3px 0 rgba(255,79,150,.25); }
.p-y2k .deco.star { position: absolute; color: #ff5d9e; z-index: 4; text-shadow: 0 0 8px rgba(255,93,158,.5); }
.p-y2k .deco.star.s1 { left: 10px; top: 8px; font-size: 16px; }
.p-y2k .deco.star.s2 { right: 12px; bottom: 10px; font-size: 20px; color: #ffb3cd; }
.p-y2k .deco.star.s3 { right: 16px; top: 10px; font-size: 12px; color: #8ecae6; }

/* 07 밤하늘 */
.p-starry {
  background:
    radial-gradient(2.2px 2.2px at 12% 16%, #fff, transparent 60%),
    radial-gradient(1.9px 1.9px at 28% 38%, #ffe9c9, transparent 60%),
    radial-gradient(1.7px 1.7px at 44% 12%, #fff, transparent 60%),
    radial-gradient(2.4px 2.4px at 62% 30%, #cfe0ff, transparent 60%),
    radial-gradient(1.8px 1.8px at 76% 14%, #fff, transparent 60%),
    radial-gradient(2px 2px at 88% 44%, #ffe9c9, transparent 60%),
    radial-gradient(1.7px 1.7px at 18% 70%, #fff, transparent 60%),
    radial-gradient(2.2px 2.2px at 68% 78%, #dfe7ff, transparent 60%),
    radial-gradient(1.7px 1.7px at 40% 88%, #fff, transparent 60%),
    linear-gradient(165deg, #101a3c 0%, #1a2551 45%, #0b1029 100%);
  color: #e9edff; --p-sub: #9fb0dd; --p-accent: #ffd166;
  box-shadow: 0 26px 50px rgba(10,15,40,.5), inset 0 0 0 1px rgba(160,190,255,.18);
}
.p-starry .p-title { color: #ffe9a8; text-shadow: 0 0 26px rgba(255,225,150,.4); }
.p-starry .deco.moon { position: absolute; right: 28px; top: 22px; width: 44px; height: 44px; border-radius: 50%; background: #ffe9b8; box-shadow: 0 0 40px rgba(255,225,160,.6); z-index: 2; }
.p-starry .deco.moon::after { content: ''; position: absolute; left: -11px; top: -7px; width: 44px; height: 44px; border-radius: 50%; background: #16204a; }
.p-starry .p-head { padding-right: 88px; }
.p-starry .p-photo { box-shadow: 0 6px 20px rgba(0,0,0,.5); }
.p-starry .p-empty { color: #8fa0cf; }

/* 08 봄꽃 보태니컬 */
.p-botanical {
  background: linear-gradient(#fdfbf3, #f5f2e4);
  color: #3d4032; --p-sub: #8f9a80; --p-accent: #7d9a63;
  box-shadow: 0 22px 44px rgba(90,90,60,.18), inset 0 0 0 1px rgba(160,175,140,.4);
}
.p-botanical .p-in::after { content: ''; position: absolute; inset: 14px; border: 1px solid rgba(150,170,130,.4); border-radius: 6px; pointer-events: none; }
.p-botanical .deco.leaf { position: absolute; width: 128px; height: 128px; z-index: 2; opacity: .95; background: no-repeat center/contain; }
.p-botanical .leaf.l1 { left: -18px; bottom: -22px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%238fae74' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 112C44 86 62 54 72 16'/%3E%3C/g%3E%3Cg fill='%23a8c48c'%3E%3Cellipse cx='42' cy='82' rx='15' ry='7' transform='rotate(-36 42 82)'/%3E%3Cellipse cx='58' cy='54' rx='14' ry='6.5' transform='rotate(-46 58 54)'/%3E%3Cellipse cx='28' cy='100' rx='13' ry='6' transform='rotate(-24 28 100)'/%3E%3C/g%3E%3C/svg%3E"); }
.p-botanical .leaf.l2 { right: -18px; top: -20px; transform: rotate(180deg); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%238fae74' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 112C44 86 62 54 72 16'/%3E%3C/g%3E%3Cg fill='%23b3cb98'%3E%3Cellipse cx='42' cy='82' rx='15' ry='7' transform='rotate(-36 42 82)'/%3E%3Cellipse cx='58' cy='54' rx='14' ry='6.5' transform='rotate(-46 58 54)'/%3E%3C/g%3E%3C/svg%3E"); }
.p-botanical .p-head { padding-right: 56px; }
.p-botanical .deco.petal { position: absolute; width: 14px; height: 14px; border-radius: 50% 0 50% 50%; background: #eab7c4; opacity: .8; right: 34px; bottom: 44px; transform: rotate(20deg); z-index: 2; }

/* 09 흑백 필름 */
.p-mono {
  background: #e9e7e3; color: #22201d; --p-sub: #6d6a64; --p-accent: #222;
  box-shadow: 0 24px 44px rgba(0,0,0,.28), inset 0 0 0 1px rgba(0,0,0,.08);
}
.p-mono .p-in { padding: 50px 30px 48px; }
.p-mono .p-title { letter-spacing: -.02em; }
.p-mono .p-photo img { filter: grayscale(1) contrast(1.06); }
.p-mono .deco.film { position: absolute; left: 0; right: 0; height: 26px; background: #171614; z-index: 4; }
.p-mono .film.top { top: 0; }
.p-mono .film.bot { bottom: 0; }
.p-mono .film::after {
  content: ''; position: absolute; inset: 7px 0;
  background: repeating-linear-gradient(90deg, #e9e7e3 0 9px, transparent 9px 21px);
}
.p-mono .p-texture { opacity: .3; mix-blend-mode: multiply; }

/* 10 체크 노트 */
.p-note {
  background-color: #fdfcf4;
  background-image:
    linear-gradient(rgba(120,160,210,.38) 1.4px, transparent 1.4px),
    linear-gradient(90deg, rgba(120,160,210,.38) 1.4px, transparent 1.4px);
  background-size: 26px 26px; background-position: 0 14px, 14px 0;
  color: #2b3a5c; --p-sub: #7b88a6;
  box-shadow: 0 22px 42px rgba(70,80,120,.2), inset 0 0 0 1px rgba(150,170,200,.5);
}
.p-note .p-in { padding-left: 54px; }
.p-note .deco.margin { position: absolute; left: 38px; top: 0; bottom: 0; width: 2px; background: rgba(230,110,120,.55); z-index: 2; }
.p-note .p-head { margin-bottom: 22px; }
.p-note .p-title { color: #1f3358; }
.p-note .p-body { line-height: 2.05; color: #26375e; }

/* 11 리본 러블리 */
.p-ribbon {
  background: linear-gradient(#fff6fa, #ffe8f1 70%, #ffdcea);
  color: #5b3a48; --p-sub: #a88393;
  box-shadow: 0 24px 44px rgba(190,120,150,.24), inset 0 0 0 1px rgba(255,190,215,.8);
}
.p-ribbon .p-in { padding-top: 58px; }
.p-ribbon .p-in::after { content: ''; position: absolute; inset: 10px; border: 3px double rgba(255,180,205,.55); border-radius: 10px; pointer-events: none; }
.p-ribbon .deco.bow { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); width: 156px; height: 62px; z-index: 4; }
.p-ribbon .bow {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 170 72'%3E%3Cpath d='M85 33C69 33 60 10 39 10 21 10 13 22 17 35 21 50 45 55 85 39Z' fill='%23ffb0cb'/%3E%3Cpath d='M85 33c16 0 25-23 46-23 18 0 26 12 22 25-4 15-28 20-68 4Z' fill='%23ffc4d9'/%3E%3Cpath d='M85 35c-5 9-11 22-20 34l13 1c6-13 8-24 9-31Z' fill='%23f28fb4'/%3E%3Cpath d='M85 35c5 9 11 22 20 34l-13 1c-6-13-8-24-9-31Z' fill='%23ffb0cb'/%3E%3Cellipse cx='85' cy='36' rx='10.5' ry='9.5' fill='%23ec6b98'/%3E%3Cellipse cx='82' cy='33' rx='3.4' ry='2.6' fill='%23fff' opacity='.5'/%3E%3C/svg%3E") center/contain no-repeat;
}
.p-ribbon .bow i, .p-ribbon .bow b { display: none; }
.p-ribbon .p-title { color: #b04c74; }

/* 12 모던 미니멀 */
.p-minimal {
  background: #fff; color: #1e1e1e; --p-sub: #9a9a9a; --p-accent: #111;
  box-shadow: 0 24px 48px rgba(0,0,0,.14), inset 0 0 0 1px rgba(0,0,0,.06);
}
.p-minimal .p-in { padding: 46px 40px 38px; }
.p-minimal .p-title { font-weight: 600; font-size: 1.32em; letter-spacing: -.02em; margin-top: 26px; }
.p-minimal .p-head { font-size: .76em; letter-spacing: .12em; text-transform: uppercase; }
.p-minimal .deco.rule { position: absolute; left: 40px; right: 40px; top: 36px; height: 1px; background: #111; z-index: 3; }
.p-minimal .p-sign { margin-top: 40px; font-size: .92em; }

/* 13 크라프트 */
.p-kraft {
  background: linear-gradient(150deg, #d9b78f, #cba675 55%, #c09b6a);
  color: #4a3423; --p-sub: #7d6144;
  box-shadow: 0 24px 46px rgba(90,60,30,.3), inset 0 0 0 1px rgba(255,235,200,.35);
}
.p-kraft .p-texture { opacity: .3; mix-blend-mode: multiply; }
.p-kraft .p-in::after { content: ''; position: absolute; inset: 14px; border: 1px dashed rgba(110,80,50,.35); border-radius: 6px; pointer-events: none; }
.p-kraft .deco.seal {
  position: absolute; left: 26px; bottom: 26px; width: 44px; height: 44px; border-radius: 50%; z-index: 4;
  background: radial-gradient(circle at 35% 30%, #c9556d, #8e2b40);
  color: #ffd9e0; display: grid; place-items: center; font-size: 15px;
  box-shadow: 0 3px 10px rgba(0,0,0,.3), inset 0 0 0 2px rgba(255,220,230,.25);
}
.p-kraft .deco.twine { position: absolute; left: 30px; top: 18px; width: 80px; height: 1.5px; background: repeating-linear-gradient(90deg, #a98b62 0 5px, transparent 5px 9px); z-index: 4; }
.p-kraft .p-title { color: #412c1c; }

/* 14 벚꽃 */
.p-sakura {
  background: linear-gradient(160deg, #fff8fb, #ffe0ea 62%, #ffcfe0);
  color: #5a3b47; --p-sub: #b58a99;
  box-shadow: 0 24px 44px rgba(210,130,160,.22), inset 0 0 0 1px rgba(255,205,220,.8);
}
.p-sakura .deco.petal { position: absolute; width: 20px; height: 20px; background: #ffc2d6; border-radius: 50% 0 50% 50%; opacity: .85; z-index: 2; box-shadow: inset 1px 1px 2px rgba(255,255,255,.6); }
.p-sakura .petal.s1 { left: 22px; top: 18px; transform: rotate(24deg); }
.p-sakura .petal.s2 { right: 30px; top: 42px; transform: rotate(-40deg) scale(.8); background: #ffd3e1; }
.p-sakura .petal.s3 { right: 44px; bottom: 30px; transform: rotate(15deg) scale(.9); }
.p-sakura .petal.s4 { left: 36px; bottom: 52px; transform: rotate(-18deg) scale(.7); background: #ffd9e6; }
.p-sakura .p-title { color: #b34f75; }

/* ============================================================
   받는 사람 화면
   ============================================================ */
.viewer { position: fixed; inset: 0; z-index: 60; overflow: hidden; }
.v-scene { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.v-bg { position: absolute; inset: 0; background: var(--scene, #f7ead9); }
.v-bokeh {
  position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.65), transparent 42%),
    radial-gradient(circle at 82% 72%, rgba(255,255,255,.5), transparent 38%),
    radial-gradient(circle at 68% 12%, rgba(255,236,200,.55), transparent 30%);
}
.v-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 8; }
.v-inner {
  position: relative; z-index: 3; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 18px 42px;
  transition: opacity .55s ease, transform .55s ease;
}
.v-kicker {
  margin: 0 0 -6px; font-family: 'Playfair Display', serif; font-style: italic;
  font-size: clamp(13px, 3.4vw, 17px); letter-spacing: .16em; text-transform: uppercase;
  color: var(--scene-ink, #6b5548); opacity: .78;
}
.v-cakebox {
  width: min(600px, 76vw); aspect-ratio: 380 / 322; position: relative;
  filter: drop-shadow(0 18px 28px rgba(60, 20, 40, .16));
  animation: cakeIn .9s cubic-bezier(.2,.9,.25,1) both;
}
@media (max-height: 760px) { .v-cakebox { width: min(430px, 68vw); } }
.v-cake, .v-cake svg { width: 100%; height: 100%; display: block; }
.v-hint {
  margin: 2px 0 0; padding: 9px 18px; border-radius: 999px;
  background: rgba(255,255,255,.66); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #4a3540; font-size: 14px; font-weight: 700; letter-spacing: -.01em;
  box-shadow: 0 8px 20px rgba(80, 30, 60, .14);
  animation: bob 1.9s ease-in-out infinite; transition: opacity .4s, transform .4s;
}
.v-hint.gone { opacity: 0; transform: translateY(6px) scale(.96); }
.v-open {
  margin-top: 16px; opacity: 0; transform: translateY(10px) scale(.96);
  border: 0; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 15px 28px; border-radius: 999px; font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ff5d9e, #ff86b6);
  box-shadow: 0 14px 30px rgba(255, 93, 158, .4);
  transition: opacity .45s cubic-bezier(.2,.9,.25,1), transform .45s cubic-bezier(.2,.9,.25,1);
}
.v-open.in { opacity: 1; transform: none; }
.v-open i { font-style: normal; font-size: 17px; }
.v-open:hover { transform: translateY(-2px); }

/* 초 인터랙션 */
.candle { cursor: pointer; }
.flame-wrap, .smoke { pointer-events: none; }
.hit { pointer-events: all; }
.candle:focus { outline: none; }
.candle:focus-visible .flame-wrap { filter: drop-shadow(0 0 7px #ffb347); }
.flame-wrap, .fl-glow, .fl-outer, .fl-core { transition: opacity .22s ease; }
.fl-outer { transform-box: fill-box; transform-origin: 50% 100%; animation: flick 1.7s ease-in-out infinite; }
.fl-core { transform-box: fill-box; transform-origin: 50% 100%; animation: flick 1.15s ease-in-out infinite reverse; }
.fl-glow { animation: glowPulse 2.4s ease-in-out infinite; }
.candle:nth-child(2n) .fl-outer { animation-duration: 2.1s; animation-delay: -.4s; }
.candle:nth-child(3n) .fl-outer { animation-duration: 1.45s; animation-delay: -.9s; }
.candle.out .flame-wrap { opacity: 0; }
.candle.out { cursor: default; }
.puff { opacity: 0; animation: puffUp 1.5s ease-out forwards; }
@keyframes flick {
  0%, 100% { transform: scale(1, 1) translate(0, 0); }
  25% { transform: scale(.93, 1.07) translate(-.6px, 0); }
  50% { transform: scale(1.05, .95) translate(.5px, -.4px); }
  75% { transform: scale(.96, 1.04) translate(.3px, .3px); }
}
@keyframes glowPulse { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
@keyframes puffUp {
  0% { opacity: .55; transform: translate(0, 0) scale(.7); }
  100% { opacity: 0; transform: translate(-3px, -26px) scale(2.2); }
}
@keyframes cakeIn { from { opacity: 0; transform: translateY(18px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* 봉투 */
.v-env { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .35s; }
.v-env.in { opacity: 1; }
.v-env.gone { opacity: 0; transform: scale(1.15); transition: opacity .5s, transform .5s; }
.env { position: relative; width: min(260px, 68vw); aspect-ratio: 10 / 7; filter: drop-shadow(0 24px 36px rgba(60,20,40,.3)); }
.env-back { position: absolute; inset: 0; border-radius: 8px; background: linear-gradient(160deg, #ffe2ec, #ffc9dc); }
.env-note { position: absolute; left: 10%; right: 10%; bottom: 12%; height: 62%; border-radius: 4px; background: #fffdf8; transform: translateY(0); transition: transform .5s cubic-bezier(.2,.9,.25,1) .15s; }
.env-front { position: absolute; inset: 0; border-radius: 8px; background: linear-gradient(160deg, #ffd3e2, #ffb9d2); clip-path: polygon(0 34%, 50% 74%, 100% 34%, 100% 100%, 0 100%); }
.env-flap { position: absolute; left: 0; right: 0; top: 0; height: 58%; background: linear-gradient(180deg, #ffc6da, #ffaecb); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; transition: transform .55s cubic-bezier(.6,.05,.3,1); border-radius: 8px 8px 0 0; }
.v-env.open .env-flap { transform: rotateX(-170deg); }
.v-env.open .env-note { transform: translateY(-28%); }
.env-seal { position: absolute; left: 50%; top: 48%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff7ea8, #d93f74); display: grid; place-items: center; font-size: 16px; box-shadow: 0 3px 10px rgba(150,30,70,.35); transition: opacity .3s; }
.v-env.open .env-seal { opacity: 0; }

/* 편지 */
.v-letter { position: absolute; inset: 0; z-index: 22; overflow: hidden; opacity: 0; transition: opacity .5s ease; }
.v-letter::before { content: ''; position: absolute; inset: 0; background: var(--scene, #f7ead9); opacity: .97; }
.v-letter > * { position: relative; }
.v-scene.is-read .v-inner { opacity: 0; transform: scale(.94); pointer-events: none; }
.v-sparks { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.v-sparks i { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle, #fff, rgba(255,255,255,0)); opacity: .85; animation: floaty 7s ease-in-out infinite; }
.v-sparks i:nth-child(1) { left: 16%; top: 26%; animation-delay: -1s; }
.v-sparks i:nth-child(2) { left: 78%; top: 22%; width: 9px; height: 9px; animation-delay: -3.2s; }
.v-sparks i:nth-child(3) { left: 26%; top: 66%; width: 5px; height: 5px; animation-delay: -2.1s; }
.v-sparks i:nth-child(4) { left: 70%; top: 70%; width: 6px; height: 6px; animation-delay: -4.6s; }
.v-sparks i:nth-child(5) { left: 48%; top: 16%; width: 4px; height: 4px; animation-delay: -0.4s; }
.v-sparks i:nth-child(6) { left: 88%; top: 52%; width: 5px; height: 5px; animation-delay: -5.4s; }
@keyframes floaty {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: .55; }
  50% { transform: translate(6px, -16px) scale(1.25); opacity: .95; }
}
.v-letter.in { opacity: 1; }
.v-letter-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding: max(24px, env(safe-area-inset-top)) 18px 40px; display: flex; flex-direction: column; align-items: center; gap: 16px; -webkit-overflow-scrolling: touch; }
.v-letter-paper { margin-top: auto; }
.v-letter-foot { margin-bottom: auto; }
.v-letter-paper { width: 100%; max-width: 560px; animation: paperIn .6s cubic-bezier(.2,.9,.25,1) both; }
.v-letter-paper .paper { --p-scale: 1; }
.v-letter-foot { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; padding: 8px 0 10px; }
.lnk { border: 0; background: rgba(255,255,255,.7); color: #4a3540; padding: 10px 16px; border-radius: 999px; font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer; text-decoration: none; box-shadow: 0 6px 16px rgba(60,20,40,.12); }
.lnk:hover { background: #fff; }
@keyframes paperIn { from { opacity: 0; transform: translateY(22px) rotateX(8deg) scale(.97); } to { opacity: 1; transform: none; } }

/* ============================================================
   잠금 화면
   ============================================================ */
.lock-wrap { position: fixed; inset: 0; z-index: 60; overflow: hidden; }
.lk-scene { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px 18px; overflow-y: auto; }
.lk-bg { position: absolute; inset: 0; background: var(--scene, radial-gradient(circle at 50% 0%, #2a1420, #140d13 55%, #0b080c)); }
.lk-bokeh { position: absolute; inset: 0; opacity: .6; background: radial-gradient(circle at 30% 20%, rgba(255,120,170,.35), transparent 45%), radial-gradient(circle at 75% 75%, rgba(255,210,140,.25), transparent 45%); }
.lk-card {
  position: relative; z-index: 3; width: min(400px, 92vw); text-align: center;
  background: rgba(255,255,255,.9); border-radius: 24px; padding: 30px 26px 24px;
  box-shadow: 0 30px 60px rgba(40, 10, 30, .35), inset 0 0 0 1px rgba(255,255,255,.7);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: #3d2b34; animation: paperIn .55s cubic-bezier(.2,.9,.25,1) both;
}
.lk-gift { font-size: 40px; line-height: 1; margin-bottom: 8px; animation: bob 2.4s ease-in-out infinite; }
.lk-kicker { font-family: 'Playfair Display', serif; font-style: italic; letter-spacing: .18em; font-size: 10px; text-transform: uppercase; color: #c07b96; margin: 0 0 8px; }
.lk-card h1 { font-size: 22px; line-height: 1.35; margin: 0 0 10px; letter-spacing: -.02em; font-weight: 800; }
.lk-sub { font-size: 12.5px; line-height: 1.7; color: #8a6b78; margin: 0 0 18px; }
.lk-f { display: block; text-align: left; margin-top: 10px; }
.lk-f span { display: block; font-size: 11px; font-weight: 700; color: #8a6b78; margin-bottom: 6px; }
.lk-f input {
  width: 100%; border: 1px solid #eccfdc; background: #fffafc; color: #3d2b34;
  border-radius: 13px; padding: 12px 14px; font-size: 15px; font-family: inherit; outline: none; transition: .16s;
}
.lk-f input:focus { border-color: #ff5d9e; box-shadow: 0 0 0 3px rgba(255,93,158,.16); }
.lk-err { min-height: 16px; margin: 9px 0 0; font-size: 11.5px; color: #d23c6a; font-weight: 600; opacity: 0; transition: .2s; }
.lk-err.on { opacity: 1; }
.lk-go {
  display: block; width: 100%; margin-top: 12px; border: 0; cursor: pointer;
  padding: 14px 18px; border-radius: 14px; font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ff5d9e, #ff86b6);
  box-shadow: 0 12px 26px rgba(255,93,158,.36); font-family: inherit; text-decoration: none; text-align: center;
  transition: .16s;
}
.lk-go:hover { transform: translateY(-1px); }
.lk-go:disabled { opacity: .6; transform: none; }
.lk-fine { font-size: 10.5px; color: #a08a95; line-height: 1.6; margin: 12px 0 0; }
.lk-fine b { color: #d0537f; }

/* ============================================================
   미리보기 모달 / 토스트
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-bg { position: absolute; inset: 0; background: rgba(10, 6, 10, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal-box {
  position: relative; z-index: 2; width: min(520px, 96vw); height: min(860px, 92vh);
  background: #0f0c10; border-radius: 22px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: 0 30px 70px rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.1);
}
.modal-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; color: #e9dfe7; font-size: 12px; font-weight: 700; background: #16111a; border-bottom: 1px solid rgba(255,255,255,.08); }
.modal-body { position: relative; flex: 1; overflow: hidden; }
.modal-body .v-scene { position: absolute; inset: 0; }
.modal-body .viewer { position: absolute; inset: 0; }
body.modal-open { overflow: hidden; }

.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 14px);
  z-index: 90; background: rgba(28, 20, 28, .94); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 11px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: .25s; max-width: 88vw; text-align: center; box-shadow: 0 12px 28px rgba(0,0,0,.35);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   장면 배경 (편지지별)
   ============================================================ */
[data-p="cream"] { --scene: radial-gradient(120% 90% at 50% 0%, #fff8ef 0%, #f7e9d7 55%, #eedcca 100%); --scene-ink: #6b5140; }
[data-p="postcard"] { --scene: radial-gradient(120% 90% at 50% 0%, #fbf2e0 0%, #f0e0c8 50%, #e4d0ad 100%); --scene-ink: #6b5240; }
[data-p="polaroid"] { --scene: radial-gradient(120% 90% at 50% 0%, #fffdfa 0%, #f1e8de 60%, #e2d4c6 100%); --scene-ink: #6b5a52; }
[data-p="cakey"] { --scene: radial-gradient(120% 90% at 50% 0%, #fff4f8 0%, #ffe1ed 60%, #ffd3e3 100%); --scene-ink: #8a4a66; }
[data-p="blackpink"] { --scene: radial-gradient(90% 75% at 50% 8%, #3c1327 0%, #180d15 55%, #0a070a 100%); --scene-ink: #ffd6e6; }
[data-p="y2k"] { --scene: radial-gradient(120% 90% at 50% 0%, #fff2f8 0%, #ffdcea 60%, #ffc9de 100%); --scene-ink: #7b3a5e; }
[data-p="starry"] { --scene: radial-gradient(80% 65% at 50% 0%, #2a366b 0%, #101a3c 45%, #070a1c 100%); --scene-ink: #dfe6ff; }
[data-p="botanical"] { --scene: radial-gradient(120% 90% at 50% 0%, #fdfbf1 0%, #eef1de 60%, #e2e8d1 100%); --scene-ink: #55603f; }
[data-p="mono"] { --scene: radial-gradient(120% 90% at 50% 0%, #fbfaf8 0%, #e3e0db 60%, #d4d0ca 100%); --scene-ink: #4a4741; }
[data-p="note"] { --scene: radial-gradient(120% 90% at 50% 0%, #fffef8 0%, #f4f5ec 60%, #ebede2 100%); --scene-ink: #3d4a68; }
[data-p="ribbon"] { --scene: radial-gradient(120% 90% at 50% 0%, #fff8fb 0%, #ffe5ef 60%, #ffd7e6 100%); --scene-ink: #7d4a60; }
[data-p="minimal"] { --scene: radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #f6f6f6 60%, #ececec 100%); --scene-ink: #3a3a3a; }
[data-p="kraft"] { --scene: radial-gradient(120% 90% at 50% 0%, #f0dcc0 0%, #d9bc95 60%, #c9a97e 100%); --scene-ink: #5a4028; }
[data-p="sakura"] { --scene: radial-gradient(120% 90% at 50% 0%, #fff9fb 0%, #ffe7ef 60%, #ffd8e6 100%); --scene-ink: #7d4a60; }

/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 900px) {
  .wrap { grid-template-columns: 1fr; padding: 14px 14px 30px; gap: 16px; }
  .pv { position: static; order: -1; }
  .pv-body { border-radius: 18px; }
  .card { border-radius: 18px; padding: 16px 15px 18px; }
  .bar { padding: 10px 14px; }
  .cakebox { max-height: 300px; }
  .studio { padding-bottom: 84px; }
  .mbar { display: flex; }
  .panel { gap: 12px; }
  .presets { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .paper-grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
  .photo-row { gap: 11px; }
  .photo-thumb { width: 74px; height: 74px; }
  .btn-row .ghost.big { width: 100%; }
  .toast { bottom: 96px; }
  .p-in { padding: 30px 22px 26px; font-size: 15px; }
  .p-note .p-in { padding-left: 42px; }
  .p-note .deco.margin { left: 28px; }
  .p-mono .p-in { padding: 44px 22px 42px; }
  .p-minimal .p-in { padding: 36px 26px 30px; }
  .p-minimal .deco.rule { left: 26px; right: 26px; top: 28px; }
  .p-ribbon .p-in { padding-top: 52px; }
  .p-cream .p-in::after, .p-botanical .p-in::after, .p-kraft .p-in::after, .p-ribbon .p-in::after { inset: 9px; }
  .p-polaroid { padding: 12px 12px 0; }
  .p-polaroid .p-in { padding: 12px 8px 26px; }
  .p-title { font-size: 1.32em; }
  .p-postcard .deco.stamp { width: 48px; height: 58px; right: 14px; top: 12px; }
  .p-postcard .deco.postmark { display: none; }
}

@media (max-width: 420px) {
  .p-starry .p-head { padding-right: 76px; }
  .presets { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .ps-emoji { font-size: 18px; }
  .ps-name { font-size: 10px; }
  .grid2 { grid-template-columns: 1fr 1fr; gap: 9px; }
  .card-h small { display: none; }
  .v-cakebox { width: min(420px, 86vw); }
  .v-hint { font-size: 13px; }
  .lk-card { padding: 24px 20px 20px; }
  .lk-card h1 { font-size: 19px; }
  .modal { padding: 0; }
  .modal-box { width: 100%; height: 100%; border-radius: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fl-outer, .fl-core, .v-hint, .lk-gift { animation: none !important; }
}
