@font-face {
  font-family: "KyoboHandwriting2024SeoWooPark";
  src: url("https://cdn.jsdelivr.net/gh/projectnoonnu/2507-1@1.0/KyoboHandwriting2024psw.woff2") format("woff2");
  font-weight: normal;
  font-display: swap;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
  margin: 0;
}

body {
  min-height: 100vh;
  overflow: hidden;
  background: #fff5f7;
  color: #3a2a30;
  font-family: "Pretendard", "Malgun Gothic", sans-serif;
  text-align: center;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.screen[hidden] {
  display: none;
}

.heart {
  font-size: 56px;
  color: #ff6b8b;
  animation: beat 1.2s ease-in-out infinite;
}

h1 {
  margin-top: 16px;
  font-size: 36px;
}

.date {
  color: #ff6b8b;
}

.sub {
  margin-top: 16px;
  min-height: 24px;
  font-size: 16px;
  color: #a08890;
}

.buttons {
  display: flex;
  gap: 24px;
  margin-top: 40px;
}

.slot {
  display: inline-block;
}

button {
  width: 140px;
  padding: 14px 0;
  border: 2px solid #ff6b8b;
  border-radius: 999px;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

#yes {
  background: #ff6b8b;
  color: #fff;
}

#yes:hover {
  background: #ff5279;
}

#no {
  position: relative;
  z-index: 1;
  background: #fff;
  color: #ff6b8b;
  transition: transform 0.18s ease-out;
}

.liar-img {
  height: 480px;
  max-height: 65vh;
  max-width: 90vw;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(58, 42, 48, 0.2);
}

#back {
  width: 200px;
  margin-top: 32px;
  background: #fff;
  color: #ff6b8b;
}

#back:hover {
  background: #ffe3ea;
}

/* 생일 축하 화면 */
body.party {
  background: radial-gradient(circle at 50% 110%, #4a1d5c 0%, #1b1035 45%, #070616 100%);
  color: #fff;
}

#fireworks,
#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#fireworks {
  z-index: 0;
}

#confetti {
  z-index: 3;
}

#balloons {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.balloon {
  position: absolute;
  bottom: -80px;
  animation: rise linear infinite;
}

.party {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.party-title {
  margin: 0;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(90deg, #ff5e7e, #ffb347, #fff275, #6bffb8, #6bc8ff, #c58bff, #ff5e7e);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 140, 190, 0.7));
  animation: rainbow 3s linear infinite, bounce 1s ease-in-out infinite;
}

.party-img {
  height: 640px;
  max-height: 66vh;
  max-width: 90vw;
  margin-top: 20px;
  border: 5px solid #fff;
  border-radius: 28px;
  cursor: pointer;
  animation:
    pop 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) both,
    glow 2.4s linear infinite,
    float 3.2s ease-in-out 0.9s infinite;
}

.party-sub {
  margin-top: 18px;
  font-size: 16px;
  color: #ffd9e6;
}

#controls {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 6;
  display: flex;
  gap: 10px;
}

#controls button.off {
  opacity: 0.4;
}

.party-sub.off {
  visibility: hidden;
}

#home {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 6;
}

/* 테스트용: 노래를 기다리지 않고 바로 편지 봉투를 띄운다 */
#skip {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 6;
  width: auto;
  padding: 10px 20px;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 16px;
}

#home,
#controls button {
  width: 52px;
  padding: 10px 0;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  font-size: 22px;
}

/* 편지 */
#letter-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(7, 6, 22, 0.6);
  animation: fade-in 1s ease-out both;
}

#letter-layer[hidden],
#letter[hidden] {
  display: none;
}

#envelope {
  position: relative;
  width: 420px;
  height: 270px;
  border-radius: 10px;
  background: #ffc2d1;
  box-shadow: 0 0 40px 8px rgba(255, 140, 190, 0.6);
  perspective: 900px;
  outline: none;
}

#envelope.rising {
  animation: envelope-rise 1.8s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

#envelope.leaving {
  animation: envelope-leave 1.2s ease-in both;
}

#letter-layer.closing {
  animation: fade-out 1.2s ease-in both;
}

#envelope.ready {
  cursor: pointer;
  animation: wiggle 1.6s ease-in-out infinite;
}

.env-flap {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 100%;
  height: 58%;
  background: #ff9db5;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top;
  transition: transform 0.6s ease-in-out;
}

.env-front {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 10px;
  background: #ffe3ea;
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}

.env-seal {
  position: absolute;
  top: 56%;
  left: 50%;
  z-index: 3;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  color: #ff5279;
  font-size: 30px;
  line-height: 56px;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}

#envelope.open .env-flap {
  z-index: 0;
  transform: rotateX(180deg);
}

#envelope.open .env-seal {
  opacity: 0;
}

#env-hint {
  margin-top: 28px;
  font-size: 20px;
  font-weight: 700;
  color: #ffd9e6;
  opacity: 0;
  transition: opacity 0.4s;
}

#env-hint.show {
  opacity: 1;
}

#letter {
  width: 780px;
  max-width: 90vw;
  max-height: 84vh;
  overflow-y: auto;
  padding: 48px 56px 36px;
  border-radius: 8px;
  background: #fffaf0;
  color: #3a2a30;
  box-shadow: 0 0 60px 10px rgba(255, 140, 190, 0.5);
  text-align: left;
  animation: letter-out 0.7s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.letter-body {
  font-family: "KyoboHandwriting2024SeoWooPark", "Malgun Gothic", sans-serif;
  font-size: 22px;
  line-height: 1.7;
  white-space: pre-line;
}

.letter-sign {
  margin-top: 28px;
  text-align: right;
}

#letter-close {
  display: block;
  margin: 32px auto 0;
  background: #fff;
  color: #ff6b8b;
}

#letter-close:hover {
  background: #ffe3ea;
}

/* 선물 확인 창 */
/* 선물 뽑기를 끝내면 파티 화면 왼쪽 가운데에 나타나는 메뉴 */
#side-menu {
  position: fixed;
  top: 50%;
  left: 24px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateY(-50%);
}

#side-menu button {
  width: 130px;
  padding: 14px 8px;
  border-color: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 15px;
  animation: letter-out 0.6s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

#side-menu button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
}

#side-menu button:disabled {
  opacity: 0.5;
  cursor: default;
}

.side-icon {
  display: block;
  margin-bottom: 6px;
  font-size: 40px;
}

.panel-text {
  margin-top: 16px;
  font-size: 18px;
  color: #a08890;
}

#studio-layer,
#result-layer,
#gift-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 6, 22, 0.6);
}

/* 생일 기념 사진관: 벽에 걸린 폴라로이드 */
#studio-layer {
  z-index: 7; /* 파티 화면의 구석 버튼들까지 덮는다 */
  flex-direction: column;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 244, 214, 0.9), transparent 60%),
    repeating-linear-gradient(90deg, #f3e3c8 0 80px, #efdcbd 80px 160px);
  color: #3a2a30;
}

#studio-close {
  position: fixed;
  top: 20px;
  left: 20px;
  width: auto;
  padding: 10px 20px;
  background: #fff;
  color: #ff6b8b;
  font-size: 16px;
}

.studio-title {
  font-size: 40px;
}

.studio-hint {
  min-height: 28px;
  margin-top: 12px;
  font-size: 20px;
  color: #8a6f5c;
}

/* 사진들이 매달린 줄 */
.photo-wall {
  position: relative;
  display: flex;
  gap: 44px;
  margin-top: 56px;
  padding-top: 26px;
}

.photo-wall::before {
  content: "";
  position: absolute;
  top: 0;
  right: -60px;
  left: -60px;
  height: 4px;
  border-radius: 2px;
  background: #a9825e;
}

.polaroid {
  position: relative;
  margin: 0;
  padding: 14px 14px 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(80, 50, 20, 0.3);
  transform: rotate(var(--tilt));
  transform-origin: top center;
}

/* 집게 */
.polaroid::before {
  content: "";
  position: absolute;
  top: -30px;
  left: 50%;
  width: 16px;
  height: 40px;
  margin-left: -8px;
  border-radius: 4px;
  background: #ff8fa8;
}

.photo {
  position: relative;
  width: 250px;
  height: 250px;
}

.photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.polaroid figcaption {
  margin-top: 12px;
  font-family: "KyoboHandwriting2024SeoWooPark", "Malgun Gothic", sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.polaroid small {
  display: block;
  margin-top: 2px;
  font-size: 16px;
  font-weight: 400;
  color: #8a6f5c;
}

/* 사진을 덮은 검은 칠(캔버스). 마우스로 문지르면 긁혀 나간다 */
.cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  transition: opacity 0.7s;
}

/* 충분히 긁으면 남은 칠이 한꺼번에 사라진다 */
.polaroid:not(.covered) .cover {
  opacity: 0;
  pointer-events: none;
}

/* 2026년 사진은 세 장을 다 지운 뒤 날아와서 붙는다 */
#new-photo {
  visibility: hidden;
}

#new-photo.flying,
#new-photo.stuck {
  visibility: visible;
}

#new-photo.flying {
  z-index: 2;
  animation: fly-in 4s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

#new-photo.stuck {
  box-shadow: 0 0 0 4px #ffd447, 0 10px 30px rgba(255, 107, 139, 0.6);
}

@keyframes fly-in {
  from {
    opacity: 0;
    transform: translate(-70vw, 60vh) rotate(-50deg) scale(1.8);
  }
  15% {
    opacity: 1;
  }
  to {
    transform: rotate(var(--tilt));
  }
}

/* 생일 결과표 */
#result-layer {
  z-index: 7;
}

.result-box {
  width: 560px;
  max-width: 92vw;
  max-height: 92vh;
  overflow-y: auto;
  padding: 36px 48px;
}

.check-list {
  width: fit-content;
  margin: 22px auto 0;
  padding: 0;
  list-style: none;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.9;
  text-align: left;
}

/* 항목이 하나씩 차례로 체크된다 */
.check-list li {
  opacity: 0;
  animation: check-in 0.4s ease-out forwards;
  animation-delay: calc(0.5s + var(--i) * 0.5s);
}

.check {
  margin-right: 10px;
}

.result-line {
  margin-top: 18px;
  font-size: 18px;
}

.result-line strong {
  font-size: 22px;
  color: #ff5279;
}

.hearts {
  min-height: 34px;
  margin-top: 6px;
  font-size: 24px;
  letter-spacing: 2px;
}

.hearts span {
  display: inline-block;
  opacity: 0;
  animation: check-in 0.3s ease-out forwards;
  animation-delay: calc(2.8s + var(--i) * 0.15s);
}

.result-done {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 900;
  color: #ff5279;
}

.preview {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 2px dashed #f0c9d3;
}

.preview-title {
  font-size: 18px;
  font-weight: 700;
}

.system-msg {
  margin-top: 12px;
  padding: 16px;
  border-radius: 10px;
  background: #1b1035;
  color: #d8ffd0;
  font-family: Consolas, "Malgun Gothic", monospace;
  font-size: 16px;
  line-height: 1.6;
}

.system-head {
  font-weight: 700;
  color: #ffd447;
}

.countdown {
  font-size: 40px;
  font-weight: 700;
  color: #fff;
}

@keyframes check-in {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 1; transform: scale(1); }
}

.gift-box {
  padding: 44px 56px;
  border-radius: 24px;
  background: #fffaf0;
  color: #3a2a30;
  box-shadow: 0 0 60px 10px rgba(255, 140, 190, 0.5);
  animation: letter-out 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}

.gift-icon {
  font-size: 64px;
  animation: beat 1.2s ease-in-out infinite;
}

.gift-box h2 {
  margin-top: 12px;
  font-size: 30px;
}

.gift-box .buttons {
  justify-content: center;
  margin-top: 32px;
}

.gift-box button {
  width: auto;
  min-width: 140px;
  padding: 14px 28px;
  background: #fff;
  color: #ff6b8b;
}

.gift-box button:hover {
  background: #ffe3ea;
}

.gift-box .primary {
  background: #ff6b8b;
  color: #fff;
}

.gift-box .primary:hover {
  background: #ff5279;
}

/* 캡슐 뽑기 */
.gacha-title {
  margin: 0;
  font-size: 40px;
  color: #fff;
}

.gacha-sub {
  min-height: 24px;
  margin-top: 10px;
  font-size: 16px;
  color: #ffd9e6;
}

#gacha-back {
  position: fixed;
  top: 20px;
  left: 20px;
  width: auto;
  padding: 10px 20px;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 16px;
}

.machine {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

/* 유리 상자 안쪽 크기는 600 x 380 (gacha.js의 좌표와 맞춰야 한다) */
.claw-box {
  position: relative;
  width: 612px;
  height: 392px;
  overflow: hidden;
  border: 6px solid #ff8fa8;
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.06) 55%);
}

.rail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 16px;
  background: #c9c9d6;
}

.claw {
  position: absolute;
  top: 16px;
  left: 360px;
  z-index: 3;
  width: 96px;
  margin-left: -48px;
  pointer-events: none;
  transition: left 0.9s ease-in-out; /* 시간은 gacha.js가 그때그때 바꾼다 */
}

.cable {
  width: 4px;
  height: 24px;
  margin: 0 auto;
  background: #e8e8f0;
  transition: height 0.8s ease-in-out;
}

.claw-head {
  position: relative;
  width: 96px;
  height: 78px;
}

.hub {
  display: block;
  width: 34px;
  height: 12px;
  margin: 0 auto;
  border-radius: 4px;
  background: #e8e8f0;
}

.prong {
  position: absolute;
  top: 6px;
  z-index: 2;
  width: 46px;
  height: 74px;
  border: 5px solid transparent;
  border-radius: 50%;
  transform-origin: top center;
  transition: transform 0.3s ease-in-out;
}

.prong.l {
  left: 2px;
  border-left-color: #e8e8f0;
}

.prong.r {
  right: 2px;
  border-right-color: #e8e8f0;
}

.claw.open .prong.l {
  transform: rotate(28deg);
}

.claw.open .prong.r {
  transform: rotate(-28deg);
}

.claw.slipping .claw-head {
  animation: slip 0.15s linear infinite alternate;
}

.exit {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 120px;
  height: 140px;
  padding-top: 106px;
  border-right: 6px solid #ff8fa8;
  border-top: 6px solid #ff8fa8;
  border-top-right-radius: 12px;
  background: #2a0a18;
  color: #ff8fa8;
  font-size: 14px;
  font-weight: 700;
}

/* 가운데 흰 동그라미 위에 선물 이모지가 보인다 */
.capsule,
.prize {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 3px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 46%, transparent 48%),
    linear-gradient(var(--c) 50%, #fff 50%);
  font-size: 24px;
  line-height: 1;
}

/* 투명한 캡슐. 위치와 회전은 gacha.js의 물리 계산이 매 프레임 정한다 */
.capsule {
  z-index: 1;
  width: 84px;
  height: 84px;
  cursor: help;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.95) 0 6%, rgba(255, 255, 255, 0.4) 7% 16%, transparent 34%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1) 55%, rgba(255, 255, 255, 0.45) 100%);
  box-shadow: inset 0 -10px 18px rgba(255, 255, 255, 0.2);
}

/* 캡슐 위아래 반쪽이 만나는 이음선 */
.capsule::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.6);
}

/* 캡슐 안에 든 쪽지 */
.cap-label {
  width: 68px;
  padding: 4px 3px;
  border: 2px solid var(--c);
  border-radius: 6px;
  background: #fffdf7;
  color: #3a2a30;
  font-family: "KyoboHandwriting2024SeoWooPark", "Malgun Gothic", sans-serif;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  word-break: keep-all;
  transform: rotate(-6deg);
}

.cap-label img {
  display: block;
  width: 100%;
  height: 30px;
  margin-bottom: 2px;
  object-fit: contain;
}

/* 캡슐에 마우스를 올리면 뜨는 상세정보 */
#cap-tip {
  position: fixed;
  z-index: 4;
  width: 260px;
  padding: 14px;
  border-radius: 16px;
  background: #fffaf0;
  color: #3a2a30;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

#cap-tip img {
  display: block;
  width: 100%;
  max-height: 170px;
  margin-bottom: 10px;
  border-radius: 8px;
  object-fit: contain;
}

#cap-tip strong {
  display: block;
  font-size: 18px;
}

#cap-tip span {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: #a08890;
}

/* 집게에 잡힌 캡슐은 집게 머리 안에 매달린다 */
.capsule.held {
  top: 14px;
  left: 50%;
  margin-left: -42px;
}

.machine-body {
  display: flex;
  align-items: center;
  gap: 28px;
  width: 612px;
  height: 96px;
  padding-left: 6px;
  border-radius: 0 0 24px 24px;
  background: linear-gradient(#ff6b8b, #e0446a);
  box-shadow: 0 0 40px 6px rgba(255, 107, 139, 0.5);
}

.machine-label {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
}

.chute {
  position: relative;
  width: 120px;
  height: 64px;
  overflow: hidden;
  border-radius: 14px;
  background: #4a1027;
  box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.5);
}

.prize {
  top: 4px;
  left: 50%;
  margin-left: -28px;
}

.prize.dropping {
  animation: capsule-drop 0.7s ease-out both;
}

.prize.ready {
  cursor: pointer;
  animation: wiggle 0.8s ease-in-out infinite;
}

.claw-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.claw-controls button {
  font-size: 22px;
  user-select: none;
}

.claw-controls button:disabled {
  opacity: 0.5;
  cursor: default;
}

#draw {
  width: 240px;
  padding: 16px 0;
  background: #ff6b8b;
  color: #fff;
}

#claw-left,
#claw-right {
  width: 72px;
  padding: 16px 0;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

#gacha-finish {
  position: fixed;
  top: 20px;
  right: 20px;
  width: auto;
  padding: 10px 20px;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 16px;
}

#gacha-finish:disabled {
  opacity: 0.5;
  cursor: default;
}

#finish-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font-size: 20px;
  font-weight: 700;
  line-height: 2;
}

#finish-layer,
#prize-layer {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 6, 22, 0.7);
}

#prize-emoji {
  font-size: 96px;
}

#prize-img {
  display: block;
  max-width: 600px;
  max-height: 46vh;
  margin: 0 auto;
  border-radius: 12px;
}

#prize-desc {
  margin-top: 10px;
  font-size: 18px;
  color: #a08890;
}

#won {
  position: fixed;
  top: 50%;
  right: 40px;
  width: 300px;
  padding: 24px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  text-align: left;
  transform: translateY(-50%);
}

#won h2 {
  font-size: 20px;
  color: #ffd9e6;
}

#won-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 17px;
  font-weight: 700;
  line-height: 2;
}

@keyframes slip {
  from { transform: rotate(-7deg); }
  to { transform: rotate(7deg); }
}

@keyframes capsule-drop {
  from { transform: translateY(-70px) rotate(-200deg); }
  60% { transform: translateY(5px) rotate(10deg); }
  to { transform: translateY(0) rotate(0); }
}

@keyframes fade-in {
  from { background: rgba(7, 6, 22, 0); }
}

@keyframes envelope-rise {
  from { transform: translateY(100vh) rotate(-8deg); }
  to { transform: translateY(0) rotate(0); }
}

@keyframes envelope-leave {
  from { transform: translateY(0) rotate(0); }
  to { transform: translateY(100vh) rotate(8deg); }
}

@keyframes fade-out {
  to { background: rgba(7, 6, 22, 0); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-2deg) scale(1); }
  50% { transform: rotate(2deg) scale(1.04); }
}

@keyframes letter-out {
  from { transform: translateY(60px) scale(0.3); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

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

@keyframes bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.04); }
}

@keyframes pop {
  from { transform: scale(0) rotate(-12deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 30px 6px #ff5e7e, 0 0 90px 20px rgba(255, 94, 126, 0.45); }
  25% { box-shadow: 0 0 30px 6px #ffd447, 0 0 90px 20px rgba(255, 212, 71, 0.45); }
  50% { box-shadow: 0 0 30px 6px #6bc8ff, 0 0 90px 20px rgba(107, 200, 255, 0.45); }
  75% { box-shadow: 0 0 30px 6px #c58bff, 0 0 90px 20px rgba(197, 139, 255, 0.45); }
}

@keyframes rise {
  from { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-60vh) rotate(8deg); }
  to { transform: translateY(-125vh) rotate(-8deg); }
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
