:root {
  --cream: #fffbe6;
  --paper: #fffdf6;
  --ink: #2b211c;
  --ink-soft: #6b5e55;
  --ink-faint: #a89c90;
  --yellow: #ffd93b;
  --yellow-soft: #fff3b0;
  --red: #ee3a2b;
  --line: #f0e4c2;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-round: "Fredoka", var(--font);
  --font-hand: "Gaegu", var(--font);
}

* { box-sizing: border-box; }

html { background: var(--cream); }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  word-break: keep-all; /* 한글을 단어 단위로 줄바꿈 */
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body:has(dialog[open]) { overflow: hidden; }

button, input, textarea { font: inherit; color: inherit; }

[hidden] { display: none !important; }

:focus-visible { outline: 3px dashed var(--ink); outline-offset: 4px; }

/* ---------- 상단: 케이크 + 메뉴 ---------- */

.masthead {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(20px + env(safe-area-inset-top)) 16px 0;
}

.cake {
  width: min(220px, 58vw);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.cake:focus-visible { outline-offset: 0; border-radius: 16px; }

.cake-svg { display: block; width: 100%; height: auto; overflow: visible; }

.cake:hover .cake-svg { animation: wiggle .6s ease-in-out; }

.cake-svg path, .cake-svg ellipse, .cake-svg .c-candle rect {
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.cake-svg .c-plate { fill: #fff; }
.cake-svg .c-body { fill: #8b5a3c; }
.cake-svg .c-filling { fill: none; stroke: #ffd6e2; stroke-width: 5; }
.cake-svg .c-frost, .cake-svg .c-top { fill: #fffaf0; }
.cake-svg .c-top { stroke: none; }
.cake-svg .c-edge { fill: none; }
.cake-svg .c-stripe { fill: none; stroke: #fff; stroke-width: 2.5; }
.cake-svg .c-wick { stroke-width: 2.5; }
.cake-svg .flame path { fill: #ffb627; stroke-width: 2.5; }
.cake-svg .flame ellipse { fill: #fff3b0; stroke: none; }
.cake-svg #sprinkles rect { stroke: none; }

.flame {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: flicker 1.1s ease-in-out infinite alternate;
}
.c-candle:nth-of-type(2) .flame { animation-delay: -.35s; }
.c-candle:nth-of-type(3) .flame { animation-delay: -.7s; }

@keyframes flicker {
  0%   { transform: scale(1, 1) rotate(-3deg); }
  50%  { transform: scale(.9, 1.1) rotate(2deg); }
  100% { transform: scale(1.05, .94) rotate(-1deg); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3deg); }
  75% { transform: rotate(3deg); }
}

.nav {
  display: flex;
  justify-content: space-between;
  width: min(420px, 100%);
  margin-top: 20px;
}

.nav a {
  position: relative;
  padding: 8px 6px;
  font-family: var(--font-round);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink);
  text-decoration: none;
  transition: transform .15s;
}

.nav a:hover { transform: translateY(-2px); }

.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: -6px;
  height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='8' viewBox='0 0 16 8'%3E%3Cpath d='M0 4 Q4 0 8 4 T16 4' fill='none' stroke='%23ee3a2b' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x center / 16px 8px;
}

/* ---------- 공통 ---------- */

/* 모바일 기준 화면. 넓은 화면에서도 폰 폭으로 가운데 정렬한다. */
main {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 36px 16px calc(80px + env(safe-area-inset-bottom));
  overflow-x: clip; /* 회전하는 선물 빛이 화면 폭을 넓히지 않도록 */
}

.view { animation: fade-up .4s ease-out; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
}

.headline, .view-head h1 {
  margin: 0;
  font-size: clamp(21px, 6vw, 25px);
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
}

.headline { margin-bottom: 52px; }

.beat { display: inline-block; animation: beat 1.8s ease-in-out infinite; }

@keyframes beat {
  0%, 40%, 100% { transform: scale(1); }
  10% { transform: scale(1.08); }
  20% { transform: scale(1); }
  30% { transform: scale(1.05); }
}

.view-head { margin-bottom: 32px; text-align: center; }
.view-head p { margin: 6px 0 0; color: var(--ink-soft); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s, background .15s;
}

.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: 3px 3px 0 var(--ink); }
.btn-primary { background: var(--yellow); }
.btn-sm { padding: 6px 14px; font-size: 13px; box-shadow: 2px 2px 0 var(--ink); }
.btn-sm:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn-danger.is-confirm { background: var(--red); color: #fff; }

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  cursor: pointer;
}

.link-btn:hover { text-decoration: underline wavy; text-underline-offset: 4px; }

.empty { padding: 24px 16px; text-align: center; color: var(--ink-soft); }
.empty h2 { margin: 0 0 6px; font-size: 18px; color: var(--ink); }
.empty p { margin: 0 0 24px; }
.empty-art { width: 130px; margin: 0 auto 20px; opacity: .5; filter: grayscale(1); }

/* ---------- 선물 상자 ---------- */

.gifts {
  --gap: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 32px var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 한 줄에 3개 */
.gifts > li { width: calc((100% - 2 * var(--gap)) / 3); }

.gift {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: opacity .4s, transform .4s, filter .4s;
}

.gift:focus-visible { outline-offset: 8px; border-radius: 20px; }

.gift-float {
  position: relative;
  display: block;
  width: 100%;
  isolation: isolate;
  animation: bob 3.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -.8s);
}

.gift-art {
  display: block;
  transform-origin: 50% 92%;
  transition: transform .25s;
}

/* 선물에 달린 날짜 태그 */
.gift-date {
  max-width: 100%;
  overflow: hidden;
  padding: 1px 9px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gift-label {
  margin-top: -4px;
  max-width: 100%;
  min-height: 1.5em;
  overflow: hidden;
  font-family: var(--font-hand);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 뚜껑이 열릴 때 뒤에서 퍼지는 빛 */
.gift-glow {
  position: absolute;
  left: 50%;
  top: 44%;
  z-index: -1;
  width: 250%;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.2);
  background:
    radial-gradient(circle, #fffbe0 0 10%, rgba(255, 233, 140, .75) 24%, transparent 62%),
    repeating-conic-gradient(rgba(255, 212, 80, .55) 0 8deg, transparent 8deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 22%, transparent 66%);
  mask: radial-gradient(circle, #000 22%, transparent 66%);
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (hover: hover) {
  .gifts:not(.is-focusing) .gift:not(.is-opened):hover .gift-art { animation: heartbeat 1s ease-in-out infinite; }
  .gifts:not(.is-focusing) .gift.is-opened:hover .gift-art { transform: rotate(-3deg) scale(1.03); }
}

/* 손가락으로 누르는 동안 살짝 눌리는 느낌 */
.gifts:not(.is-focusing) .gift:active .gift-art { transform: scale(.93); }

@keyframes heartbeat {
  0%, 60%, 100% { transform: scale(1); }
  15% { transform: scale(1.08); }
  30% { transform: scale(1); }
  45% { transform: scale(1.05); }
}

.gift.is-shaking .gift-art { animation: shake .7s ease-in-out; }

@keyframes shake {
  0%, 100% { transform: rotate(0); }
  12% { transform: rotate(-9deg) translateY(-4px); }
  26% { transform: rotate(8deg) translateY(-6px); }
  40% { transform: rotate(-7deg) translateY(-3px); }
  54% { transform: rotate(6deg); }
  68% { transform: rotate(-4deg) scale(1.04); }
  84% { transform: rotate(2deg) scale(1.06, .95); }
}

.gifts.is-focusing .gift:not(.is-active) { opacity: .3; transform: scale(.92); filter: saturate(.3); }
.gifts.is-focusing .gift.is-active { transform: scale(1.12); }

/* 선물 상자 그림 (app.js 의 GIFT_SVG) */
.gift-svg { display: block; width: 100%; height: auto; overflow: visible; }

.gift-svg path, .gift-svg ellipse {
  stroke: var(--ink);
  stroke-width: 3.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.gift-svg .gift-shadow { fill: rgba(43, 33, 28, .1); stroke: none; }
.gift-svg .g-box { fill: #ffd93b; }
.gift-svg .g-dark { fill: #f2b705; }
.gift-svg .g-light { fill: #ffe873; }
.gift-svg .g-ribbon { fill: #ee3a2b; }
.gift-svg .g-ribbon-dark { fill: #c42a1d; }
.gift-svg .g-inner { fill: #a87400; }
.gift-svg .g-tissue { fill: #fff; stroke-width: 3; }
.gift-svg .g-shine { fill: none; stroke: rgba(255, 255, 255, .8); stroke-width: 4; }
.gift-svg .g-crease { fill: none; stroke-width: 2.5; }

.gift-lid {
  transform-box: view-box;
  transform-origin: 38px 104px;
  transition: transform .4s cubic-bezier(.3, 1.5, .5, 1);
}

.gift-inside { opacity: 0; }

.gift-tissue {
  transform-box: view-box;
  transform-origin: 100px 106px;
}

.gift.is-opened .gift-inside { opacity: 1; }
.gift.is-opened .gift-lid { transform: translate(-2px, -4px) rotate(-24deg); }

.gift.is-opening .gift-lid { animation: lid-pop 1s cubic-bezier(.2, .9, .3, 1) forwards; }
.gift.is-opening .gift-tissue { animation: tissue-rise .5s .2s cubic-bezier(.3, 1.6, .5, 1) both; }
.gift.is-opening .gift-glow { animation: glow 1.8s ease-out forwards; }

@keyframes lid-pop {
  0%   { transform: none; }
  30%  { transform: translate(8px, -58px) rotate(12deg); }
  55%  { transform: translate(-4px, -42px) rotate(-32deg); }
  100% { transform: translate(-2px, -4px) rotate(-24deg); }
}

@keyframes tissue-rise {
  from { transform: translateY(12px) scaleY(.3); }
}

@keyframes glow {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(0); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1) rotate(70deg); }
}

/* ---------- 편지 ---------- */

.letters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 36px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.letter-card {
  position: relative;
  padding: 28px 22px 16px;
  background: #fffef9;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(var(--tilt, 0deg));
  transition: transform .2s;
}

.letter-card:hover { transform: rotate(0) translateY(-3px); }

.tape {
  position: absolute;
  top: -13px;
  left: 50%;
  width: 84px;
  height: 24px;
  background: rgba(255, 217, 59, .7);
  border: 1.5px solid rgba(43, 33, 28, .2);
  transform: translateX(-50%) rotate(-3deg);
}

.letter-card-title {
  margin: 0 0 8px;
  font-family: var(--font-hand);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.letter-card-message {
  min-height: 90px;
  margin: 0;
  font-family: var(--font-hand);
  font-size: 20px;
  line-height: 30px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: repeating-linear-gradient(transparent 0 29px, var(--line) 29px 30px);
}

.letter-card.is-sealed .letter-card-message { filter: blur(6px); user-select: none; }

.letter-card.is-sealed::after {
  content: "선물을 열면 읽을 수 있어요";
  position: absolute;
  top: 54%;
  left: 50%;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.letter-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- 업로드 (CAMERA) ---------- */

.camera {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.login-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.login-art { width: 80px; }
.login-text { margin: 0 0 4px; font-weight: 700; }
.login-form .input { text-align: center; }
.login-form .btn { width: 100%; }

.logout { align-self: center; color: var(--ink-soft); }

.panel {
  padding: 18px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 24px;
  box-shadow: 5px 5px 0 var(--ink);
}

.upload-form { display: flex; flex-direction: column; gap: 20px; }

.dropzone {
  border: 2.5px dashed var(--ink);
  border-radius: 18px;
  background: #fff;
  transition: background .15s, transform .15s;
}

.dropzone.is-over { background: var(--yellow-soft); transform: scale(1.01); }

.dz-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 28px 16px 24px;
  border: 0;
  border-radius: 16px;
  background: none;
  cursor: pointer;
}

.dz-empty:hover .dz-icon { animation: heartbeat 1s ease-in-out infinite; }
.dz-icon { width: 76px; margin-bottom: 8px; }
.dz-title { font-weight: 700; }
.dz-title em { font-style: normal; color: var(--red); text-decoration: underline wavy; text-underline-offset: 4px; }

@media (hover: none), (pointer: coarse) {
  .only-pointer { display: none; }
}
.dz-hint { font-size: 13px; color: var(--ink-soft); }

.dz-file { display: flex; align-items: center; gap: 14px; padding: 12px; }
.file-info { flex: 1; min-width: 0; }
.file-name { margin: 0; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { margin: 2px 0 6px; font-size: 13px; color: var(--ink-soft); }

.thumb {
  position: relative;
  display: block;
  flex: none;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #3a2f29;
}

.thumb-sm { width: 120px; }

.thumb.is-loading {
  background: linear-gradient(90deg, #3a2f29 0%, #57483f 50%, #3a2f29 100%) 0 0 / 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer { to { background-position: -200% 0; } }

.thumb-bg {
  position: absolute;
  inset: -12px;
  width: calc(100% + 24px);
  height: calc(100% + 24px);
  object-fit: cover;
  filter: blur(12px) brightness(.75);
}

.thumb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14px; font-weight: 700; }
.field-label em { margin-left: 4px; font-size: 13px; font-style: normal; font-weight: 500; color: var(--ink-faint); }

.input {
  width: 100%;
  padding: 12px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  resize: vertical;
  transition: box-shadow .15s;
}

.input::placeholder { color: var(--ink-faint); }
.input:focus { outline: none; box-shadow: 3px 3px 0 var(--ink); }
.input:disabled { opacity: .6; }
.input-hand { font-family: var(--font-hand); font-size: 20px; line-height: 1.5; }

.progress { display: flex; align-items: center; gap: 12px; }

.progress-track {
  flex: 1;
  height: 16px;
  overflow: hidden;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(-45deg, var(--yellow) 0 8px, #ffc400 8px 16px);
  background-size: 22.6px 22.6px;
  transition: width .2s;
  animation: stripes .6s linear infinite;
}

@keyframes stripes { to { background-position: 22.6px 0; } }

.progress-label { min-width: 4.5em; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }

.form-error { margin: 0; font-size: 14px; font-weight: 600; color: var(--red); }

.form-foot { display: flex; justify-content: flex-end; gap: 10px; }

.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-title h2 { margin: 0; font-size: 18px; }
.count { margin-left: 2px; font-family: var(--font-round); color: var(--red); }

.pack-list { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }

.pack-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 18px;
}

.pack-thumb { width: 88px; cursor: pointer; }

.thumb-play {
  position: absolute;
  inset: 0;
  margin: auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--ink);
  transition: transform .15s;
}

.thumb-play svg { width: 14px; height: 14px; margin-left: 2px; }
.pack-thumb:hover .thumb-play { transform: scale(1.12); }

.pack-info { flex: 1; min-width: 0; }
.pack-title { margin: 0; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.pack-meta { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }

.pack-empty {
  margin: 0;
  padding: 28px;
  border: 2.5px dashed var(--ink-faint);
  border-radius: 18px;
  color: var(--ink-soft);
  text-align: center;
}

/* ---------- HBD ---------- */

.hbd { padding-top: 12px; text-align: center; }

.hbd-title {
  margin: 0 0 18px;
  font-family: var(--font-round);
  font-size: clamp(40px, 12vw, 58px);
  font-weight: 700;
  line-height: 1.15;
}

.hbd-word { display: inline-block; margin: 0 .18em; white-space: nowrap; }

.hbd-letter {
  display: inline-block;
  color: var(--c);
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
  animation: wave 1.8s ease-in-out infinite;
  animation-delay: calc(var(--d) * .08s);
}

@keyframes wave {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-14px) rotate(-5deg); }
}

.hbd-sub { margin: 0 0 32px; font-family: var(--font-hand); font-size: 23px; }

/* ---------- 영상 모달 ---------- */

.letter-modal {
  width: min(448px, calc(100% - 28px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.letter-modal::backdrop { background: rgba(43, 33, 28, .55); backdrop-filter: blur(3px); }

.letter-wrap { position: relative; }

.letter-modal[open] .letter-wrap { animation: pop-in .55s cubic-bezier(.3, 1.5, .5, 1); }

@keyframes pop-in {
  from { opacity: 0; transform: scale(.55) rotate(-5deg); }
}

/* 내용이 길면 카드 안에서 스크롤된다 */
.letter-sheet {
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 6px 6px 0 var(--ink);
}

/* 폰으로 찍은 세로 영상도 크게 보이도록 영상 비율을 그대로 따른다 */
.letter-video {
  display: block;
  width: 100%;
  height: auto;
  min-height: 200px;
  max-height: 64vh;
  max-height: 64dvh;
  object-fit: contain;
  background: #1d1714;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
}

.letter-body { padding: 14px 6px 4px; }
.letter-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.letter-date { margin: 2px 0 0; font-size: 13px; color: var(--ink-soft); }

.letter-message {
  margin: 12px 0 0;
  font-family: var(--font-hand);
  font-size: 22px;
  line-height: 32px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: repeating-linear-gradient(transparent 0 31px, var(--line) 31px 32px);
}

.close-btn {
  position: absolute;
  top: -14px;
  right: -10px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform .2s;
}

.close-btn:hover { transform: rotate(90deg); }
.close-btn svg { width: 20px; height: 20px; }

/* ---------- 기타 ---------- */

/* 색종이가 화면 밖으로 날아가도 페이지 폭이 늘어나지 않도록 이 레이어 안에 가둔다 */
.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  overflow: hidden;
  pointer-events: none;
}

.confetti { position: absolute; will-change: transform, opacity; }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(255, 251, 230, .85);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.drop-card {
  padding: 32px 44px;
  background: #fff;
  border: 3px dashed var(--ink);
  border-radius: 28px;
  font-size: 19px;
  font-weight: 800;
  text-align: center;
}

.drop-gift { width: 96px; margin: 0 auto 14px; animation: heartbeat 1s ease-in-out infinite; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 100;
  padding: 10px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .25s, transform .25s;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
