:root {
  --pink-1: #ffeaf5;
  --pink-2: #ffd7ee;
  --pink-3: #ffafd9;
  --pink-4: #ff6fb8;
  --pink-5: #d55298;
  --ink: #5a2a4c;
  --ink-soft: #7a3f66;
  --cream: #fff7fc;
}


* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Pixelify Sans", monospace;
  color: var(--ink);
  background:
    radial-gradient(86vmax 68vmax at 10% 10%, rgba(255, 255, 255, 0.56), transparent 62%),
    radial-gradient(84vmax 70vmax at 88% 90%, rgba(255, 186, 224, 0.52), transparent 66%),
    radial-gradient(52vmax 42vmax at 52% 46%, rgba(255, 228, 243, 0.34), transparent 72%),
    linear-gradient(145deg, #ffedf8 0%, #ffd6ec 45%, #ffafd8 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

button,
[role="button"] {
  touch-action: manipulation;
}

.panel {
  border: 4px solid #6c2f58;
  outline: 3px solid var(--pink-4);
  background: rgba(255, 249, 253, 0.95);
  box-shadow: 0 12px 0 #d46ca9;
}

.loading-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 18% 20%, #fff2fb 0 18%, transparent 38%),
    radial-gradient(circle at 85% 82%, #ffdff1 0 16%, transparent 35%),
    linear-gradient(150deg, #ffcae8, #ff8ec6);
}

.loading-card {
  width: min(760px, 92vw);
  padding: 24px;
  text-align: center;
  border-radius: 34px;
  border: 1px solid rgba(255, 142, 202, 0.4);
  background: linear-gradient(158deg, rgba(255, 252, 254, 0.88), rgba(255, 236, 248, 0.82));
  box-shadow:
    0 20px 42px rgba(152, 47, 108, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
}

.loading-card h1,
.home-card h1 {
  margin: 0 0 8px;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(16px, 2.5vw, 34px);
  color: #fffdfd;
  text-shadow: 2px 2px #ff7fbe, 0 8px 16px rgba(208, 77, 145, 0.38);
}

.loading-card p,
.loading-text,
.subtitle {
  margin: 0;
  font-size: clamp(22px, 2.8vw, 30px);
}

.loading-wrap { margin-top: 10px; }

.loading-couple-wrap {
  position: relative;
  width: min(320px, 72vw);
  height: 190px;
  margin: 0 auto -10px;
}

.loading-couple,
.loading-heart-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.loading-heart-overlay { pointer-events: none; }

.bar-shell {
  width: min(580px, 88%);
  margin: 0 auto;
}

.loading-bar {
  height: 18px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 1px 6px rgba(124, 29, 85, 0.15), 0 8px 20px rgba(187, 39, 118, 0.2);
  overflow: hidden;
}

.loading-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff73bc, #ff4fa6 45%, #ff8ecf);
  transition: width 0.2s ease;
}

.loading-text {
  margin-top: 10px;
  color: var(--ink-soft);
  font-weight: 700;
}

.home-screen,
.game-screen {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px 12px;
  background:
    radial-gradient(60vmax 44vmax at 14% 16%, rgba(255, 255, 255, 0.36), transparent 72%),
    radial-gradient(52vmax 46vmax at 86% 84%, rgba(255, 182, 225, 0.28), transparent 74%);
}

.game-screen {
  padding: 0;
}

.home-screen::before,
.home-screen::after,
.game-screen::before,
.game-screen::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.home-screen::before,
.game-screen::before {
  inset: -8%;
  opacity: 0.48;
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.5) 0 2px, transparent 3px),
    radial-gradient(circle at 76% 32%, rgba(255, 243, 251, 0.5) 0 2px, transparent 3px),
    radial-gradient(circle at 44% 78%, rgba(255, 237, 247, 0.48) 0 2px, transparent 3px),
    radial-gradient(circle at 86% 70%, rgba(255, 207, 234, 0.42) 0 3px, transparent 4px);
  background-size: 160px 160px, 220px 220px, 190px 190px, 240px 240px;
  animation: bgSparkleDrift 24s linear infinite;
}

.home-screen::after,
.game-screen::after {
  width: 58vmax;
  height: 58vmax;
  left: -14vmax;
  top: 12%;
  border-radius: 999px;
  opacity: 0.74;
  filter: blur(6px);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.36) 0%, rgba(255, 255, 255, 0) 67%);
  box-shadow: 70vmax 30vmax 0 0 rgba(255, 167, 218, 0.24);
  animation: bgBlobFloat 17s ease-in-out infinite alternate;
}

.home-card,
.console-body {
  position: relative;
  z-index: 2;
}

.home-card {
  width: min(980px, 94vw);
  padding: 20px;
  text-align: center;
  overflow: hidden;
  border-radius: 36px;
  border: 1px solid rgba(255, 143, 202, 0.38);
  background: linear-gradient(160deg, rgba(255, 252, 254, 0.9), rgba(255, 238, 249, 0.84));
  box-shadow:
    0 24px 44px rgba(152, 47, 108, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.chip {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 10px;
  border: 1px solid rgba(146, 67, 107, 0.36);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(104, 53, 83, 0.9);
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
}

.couple-wrap {
  position: relative;
  width: min(640px, 100%);
  aspect-ratio: 16 / 9;
  margin: 14px auto 0;
  border: 1px solid rgba(255, 144, 202, 0.52);
  border-radius: 24px;
  background: linear-gradient(180deg, #ffeef9, #ffd1ea);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 14px 30px rgba(157, 59, 117, 0.15);
  overflow: hidden;
}

.couple-lottie,
.overlay-heart {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.overlay-heart { pointer-events: none; }

.hero-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 3;
}

.pixel-btn {
  -webkit-appearance: none;
  appearance: none;
  border: 3px solid #6e315a;
  outline: 2px solid #ff7abd;
  background: linear-gradient(180deg, #ffabda, #ff68b3);
  color: #fff;
  font-family: "Press Start 2P", monospace;
  font-size: 11px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: 0 6px 0 #d0629f;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.pixel-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}

.pixel-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 0 #d0629f;
}

.play-btn {
  min-width: 190px;
  font-size: 12px;
  letter-spacing: 0.4px;
}

#playBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid rgba(131, 69, 105, 0.62);
  background: linear-gradient(135deg, #ffbadf, #ff76bb 55%, #ff96cb);
  color: #fffdfd;
  box-shadow: 0 12px 24px rgba(187, 66, 132, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

#playBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px rgba(187, 66, 132, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  filter: brightness(1.03);
}

.console-body {
  position: relative;
  width: min(620px, 72vw);
  max-width: 72vw;
  aspect-ratio: 594 / 881;
  height: auto;
  background-image: url("assets/frame3-tight.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border: none;
  box-shadow: none;
  padding: 0;
  touch-action: manipulation;
  user-select: none;
}

.console-top {
  display: none;
}

.console-screen-wrap {
  position: absolute;
  left: 9%;
  top: 8.5%;
  width: 82%;
  height: 41%;
  border-radius: 4px;
  border: 2px solid #e863aa;
  padding: 2px;
  background: #f7cadf;
}

#rescueGame {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  border-radius: 12px;
  border: 3px solid #bf5f95;
  background: #ffe3f1;
}

.hit-zone {
  position: absolute;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 3;
  -webkit-appearance: none;
  appearance: none;
}

.zone-left {
  left: 7%;
  top: 60%;
  width: 16%;
  height: 13%;
}

.zone-right {
  left: 25%;
  top: 60%;
  width: 16%;
  height: 13%;
}

.zone-action {
  left: 64%;
  top: 57%;
  width: 22%;
  height: 17%;
}

.popup-open {
  overflow: hidden;
}

.rose-popup {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.4vw, 28px);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 243, 251, 0.94) 0 14%, transparent 34%),
    radial-gradient(circle at 86% 84%, rgba(255, 199, 231, 0.86) 0 16%, transparent 36%),
    linear-gradient(155deg, rgba(255, 148, 205, 0.95), rgba(255, 106, 182, 0.95));
  backdrop-filter: blur(6px);
  animation: popupBgFlow 8s ease-in-out infinite alternate;
}

.rose-popup::before,
.rose-popup::after {
  content: "";
  position: absolute;
  width: 62vmax;
  height: 62vmax;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 64%);
  animation: roseDrift 9s ease-in-out infinite;
}

.rose-popup::before {
  top: -34vmax;
  left: -22vmax;
}

.rose-popup::after {
  right: -30vmax;
  bottom: -36vmax;
  animation-delay: -3.8s;
}

.rose-popup-card {
  position: relative;
  width: min(920px, 95vw);
  padding: 0;
  text-align: center;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: rosePop 0.35s cubic-bezier(0.2, 0.75, 0.2, 1);
  isolation: isolate;
}

.rose-popup-card::before {
  content: none;
}

.rose-title {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-size: clamp(54px, 8vw, 96px);
  line-height: 0.9;
  color: #ea4d9f;
  text-shadow: 0 6px 20px rgba(231, 104, 170, 0.62), 0 1px 0 #fff;
}

.rose-subtitle-popup {
  margin: -4px 0 8px;
  font-family: "Pixelify Sans", monospace;
  font-size: clamp(16px, 2.4vw, 23px);
  letter-spacing: 0.4px;
  color: var(--ink-soft);
}

.rose-sparkles {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
}

.rose-sparkles span {
  position: absolute;
  width: 15px;
  height: 15px;
  background: radial-gradient(circle, #fff, #ffd0ea 66%, transparent 70%);
  border-radius: 999px;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.9));
  animation: sparkleFloat 2.4s ease-in-out infinite;
}

.rose-sparkles span:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.rose-sparkles span:nth-child(2) { left: 22%; top: 8%; animation-delay: 0.4s; }
.rose-sparkles span:nth-child(3) { left: 79%; top: 12%; animation-delay: 0.9s; }
.rose-sparkles span:nth-child(4) { left: 90%; top: 28%; animation-delay: 1.4s; }
.rose-sparkles span:nth-child(5) { left: 16%; top: 72%; animation-delay: 1.8s; }
.rose-sparkles span:nth-child(6) { left: 86%; top: 70%; animation-delay: 2.2s; }

.rose-image-wrap {
  position: relative;
  width: min(760px, 90vw);
  padding: 8px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 154, 206, 0.68), rgba(255, 228, 242, 0.78));
  box-shadow: 0 18px 34px rgba(151, 29, 95, 0.32);
  animation: imageFloat 3s ease-in-out infinite;
}

.rose-image-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0) 46%);
  pointer-events: none;
}

.rose-bouquet {
  width: 100%;
  max-height: 64vh;
  object-fit: contain;
  image-rendering: auto;
  display: block;
  border-radius: 14px;
  border: 2px solid rgba(255, 129, 192, 0.72);
  box-shadow: 0 10px 26px rgba(129, 30, 83, 0.36);
}

.rose-close-btn {
  margin-top: 6px;
  min-width: 144px;
  border: 2px solid #8a2f67;
  background: linear-gradient(180deg, #fff7fc, #ffdff1);
  color: #742d5b;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #d36aa5, 0 8px 18px rgba(169, 46, 113, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.rose-close-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.rose-close-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #d36aa5;
}

.rose-petals {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.rose-petals span {
  position: absolute;
  bottom: -8%;
  width: clamp(10px, 2vw, 18px);
  height: clamp(14px, 2.4vw, 24px);
  border-radius: 999px 999px 999px 0;
  background: linear-gradient(180deg, rgba(255, 205, 232, 0.95), rgba(255, 120, 188, 0.85));
  transform: rotate(35deg);
  opacity: 0.78;
  animation: petalsRise 6.8s linear infinite;
}

.rose-petals span:nth-child(1) { left: 8%; animation-delay: -0.3s; }
.rose-petals span:nth-child(2) { left: 16%; animation-delay: -1.5s; }
.rose-petals span:nth-child(3) { left: 24%; animation-delay: -2.7s; }
.rose-petals span:nth-child(4) { left: 33%; animation-delay: -0.9s; }
.rose-petals span:nth-child(5) { left: 42%; animation-delay: -3.4s; }
.rose-petals span:nth-child(6) { left: 50%; animation-delay: -2.1s; }
.rose-petals span:nth-child(7) { left: 58%; animation-delay: -0.5s; }
.rose-petals span:nth-child(8) { left: 67%; animation-delay: -4.1s; }
.rose-petals span:nth-child(9) { left: 75%; animation-delay: -1.7s; }
.rose-petals span:nth-child(10) { left: 83%; animation-delay: -2.9s; }
.rose-petals span:nth-child(11) { left: 90%; animation-delay: -0.8s; }
.rose-petals span:nth-child(12) { left: 95%; animation-delay: -3.6s; }

@keyframes bgSparkleDrift {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-18px, -10px, 0); }
  100% { transform: translate3d(-36px, -18px, 0); }
}

@keyframes bgBlobFloat {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(26px, -16px, 0) scale(1.06); }
  100% { transform: translate3d(6px, 14px, 0) scale(0.98); }
}

@keyframes rosePop {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes roseDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -14px, 0) scale(1.05); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes sparkleFloat {
  0% { transform: translateY(0) scale(0.7); opacity: 0.6; }
  50% { transform: translateY(-10px) scale(1); opacity: 1; }
  100% { transform: translateY(0) scale(0.7); opacity: 0.6; }
}

@keyframes popupBgFlow {
  0% { filter: saturate(1) brightness(1); }
  100% { filter: saturate(1.08) brightness(1.05); }
}

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

@keyframes petalsRise {
  0% {
    transform: translate3d(0, 0, 0) rotate(35deg);
    opacity: 0;
  }
  15% {
    opacity: 0.82;
  }
  100% {
    transform: translate3d(34px, -118vh, 0) rotate(300deg);
    opacity: 0;
  }
}

.music-popup {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.5vw, 28px);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 244, 251, 0.9) 0 14%, transparent 34%),
    radial-gradient(circle at 84% 80%, rgba(255, 198, 231, 0.88) 0 16%, transparent 36%),
    linear-gradient(150deg, rgba(255, 145, 204, 0.94), rgba(255, 106, 181, 0.94));
  backdrop-filter: blur(6px);
}

.music-popup-card {
  width: min(920px, 95vw);
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  text-align: center;
  animation: rosePop 0.34s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.music-title {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-size: clamp(48px, 7.5vw, 84px);
  line-height: 0.9;
  color: #ea4d9f;
  text-shadow: 0 6px 20px rgba(231, 104, 170, 0.62), 0 1px 0 #fff;
}

.music-subtitle {
  margin: 2px 0 12px;
  font-family: "Pixelify Sans", monospace;
  font-size: clamp(16px, 2.5vw, 24px);
  color: var(--ink-soft);
}

.music-frame-wrap {
  width: min(820px, 100%);
  margin: 0 auto;
  border-radius: 18px;
  border: 2px solid #f36daf;
  background: linear-gradient(140deg, #ffd8ed, #ffc1e1);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.62), 0 14px 26px rgba(155, 36, 102, 0.28);
  padding: clamp(8px, 1.8vw, 12px);
}

.music-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
  display: block;
  background: #000;
}

.music-close-btn {
  margin-top: 12px;
  min-width: 154px;
  border: 2px solid #8a2f67;
  background: linear-gradient(180deg, #fff7fc, #ffdff1);
  color: #742d5b;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #d36aa5, 0 8px 18px rgba(169, 46, 113, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.music-close-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.music-close-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #d36aa5;
}

.gift-popup {
  position: fixed;
  inset: 0;
  z-index: 1240;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.5vw, 28px);
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 244, 251, 0.9) 0 14%, transparent 35%),
    radial-gradient(circle at 86% 82%, rgba(255, 196, 230, 0.88) 0 17%, transparent 38%),
    linear-gradient(155deg, rgba(255, 145, 202, 0.95), rgba(255, 102, 177, 0.95));
  backdrop-filter: blur(6px);
}

.gift-popup-card {
  width: min(920px, 96vw);
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  text-align: center;
  animation: rosePop 0.34s cubic-bezier(0.2, 0.75, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gift-title {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-size: clamp(52px, 7.8vw, 88px);
  line-height: 0.9;
  color: #ea4d9f;
  text-shadow: 0 6px 20px rgba(231, 104, 170, 0.62), 0 1px 0 #fff;
}

.gift-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(15px, 2.3vw, 22px);
}

.gift-tap-area {
  width: min(760px, 100%);
  min-height: clamp(320px, 52vh, 560px);
  margin: 0 auto;
  border: 2px solid #f26cad;
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.55) 0 8%, transparent 30%),
    linear-gradient(155deg, #ffe4f4, #ffcde7);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.62), 0 14px 26px rgba(155, 36, 102, 0.24);
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.gift-tap-area:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.gift-box-visual {
  position: relative;
  width: clamp(220px, 34vw, 340px);
  aspect-ratio: 1 / 1;
  transform: translateY(0);
  transition: transform 0.45s ease;
}

.gift-box-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 16px 20px rgba(167, 43, 106, 0.3));
  transition: opacity 0.45s ease, transform 0.52s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gift-box-open-img {
  opacity: 0;
  transform: translateY(16px) scale(0.94);
}

.gift-ticket-wrap {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 14px;
  bottom: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
  pointer-events: none;
  z-index: 3;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(41, 114, 198, 0.45) rgba(255, 255, 255, 0.52);
}

.flight-ticket {
  border-radius: 14px;
  border: 1px solid #7fb0e2;
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(35, 86, 146, 0.22);
  overflow: hidden;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #243041;
}

.flight-ticket-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #157bd7, #24a4ff);
  color: #fff;
}

.flight-ticket-top strong {
  font-size: clamp(11px, 1.8vw, 15px);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flight-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.2);
  font-size: 10px;
  font-weight: 700;
}

.flight-ticket-main {
  padding: 10px 12px 12px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.flight-airline {
  margin: 0 0 8px;
  font-size: clamp(12px, 1.7vw, 14px);
  font-weight: 700;
  color: #283347;
}

.flight-times {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: end;
}

.flight-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.flight-col-right {
  text-align: right;
}

.flight-time {
  font-size: clamp(24px, 3.6vw, 36px);
  font-weight: 800;
  line-height: 1;
  color: #1f2939;
}

.flight-city {
  font-size: clamp(11px, 1.5vw, 14px);
  font-weight: 700;
  color: #4c5870;
}

.flight-mid {
  min-width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.flight-mid::before {
  content: "✈";
  font-size: 18px;
  line-height: 1;
  color: #77859a;
  margin-bottom: 1px;
}

.flight-duration {
  font-size: 11px;
  font-weight: 700;
  color: #758195;
  white-space: nowrap;
}

.flight-stop {
  font-size: 10px;
  color: #95a1b3;
}

.gift-ticket-wrap::-webkit-scrollbar {
  width: 6px;
}

.gift-ticket-wrap::-webkit-scrollbar-thumb {
  background: rgba(40, 111, 193, 0.48);
  border-radius: 999px;
}

.gift-ticket-wrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.52);
  border-radius: 999px;
}

.gift-ticket-image {
  width: 100%;
  max-width: 640px;
  max-height: 62vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 16px;
  border: 2px solid #ff9bd0;
  background: #fff7fc;
  box-shadow: 0 14px 28px rgba(146, 31, 92, 0.3);
}

.gift-tap-area.is-open .gift-box-visual {
  opacity: 0.12;
  transform: translateY(-92px) scale(0.72);
}

.gift-tap-area.is-open .gift-box-closed-img {
  opacity: 0;
  transform: translateY(-26px) scale(0.88);
}

.gift-tap-area.is-open .gift-box-open-img {
  opacity: 1;
  transform: translateY(-2px) scale(1);
}

.gift-tap-area.is-open .gift-ticket-wrap {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gift-tap-area.is-open::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55) 0 2%, transparent 13%),
    radial-gradient(circle at 72% 32%, rgba(255, 255, 255, 0.6) 0 2%, transparent 13%),
    radial-gradient(circle at 52% 18%, rgba(255, 231, 123, 0.42) 0 11%, transparent 36%);
  pointer-events: none;
  animation: giftSparkle 1.6s ease-in-out infinite alternate;
}

.gift-close-btn {
  margin-top: 12px;
  min-width: 160px;
  border: 2px solid #8a2f67;
  background: linear-gradient(180deg, #fff7fc, #ffdff1);
  color: #742d5b;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #d36aa5, 0 8px 18px rgba(169, 46, 113, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.gift-close-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.gift-close-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #d36aa5;
}

@keyframes giftSparkle {
  from {
    opacity: 0.55;
    transform: scale(1);
  }
  to {
    opacity: 0.92;
    transform: scale(1.02);
  }
}

.letter-popup {
  position: fixed;
  inset: 0;
  z-index: 1235;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.5vw, 28px);
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 244, 251, 0.92) 0 14%, transparent 35%),
    radial-gradient(circle at 84% 80%, rgba(255, 198, 231, 0.9) 0 17%, transparent 38%),
    linear-gradient(155deg, rgba(255, 149, 205, 0.95), rgba(255, 110, 182, 0.95));
  backdrop-filter: blur(6px);
}

.letter-popup-card {
  width: min(920px, 96vw);
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  text-align: center;
  animation: rosePop 0.34s cubic-bezier(0.2, 0.75, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.letter-title {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-size: clamp(52px, 7.8vw, 88px);
  line-height: 0.9;
  color: #ea4d9f;
  text-shadow: 0 6px 20px rgba(231, 104, 170, 0.62), 0 1px 0 #fff;
}

.letter-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(15px, 2.3vw, 22px);
}

.letter-tap-area {
  width: min(760px, 100%);
  min-height: clamp(320px, 52vh, 560px);
  margin: 0 auto;
  border: 2px solid #f26cad;
  border-radius: 20px;
  background:
    radial-gradient(circle at 20% 14%, rgba(255, 255, 255, 0.55) 0 8%, transparent 30%),
    linear-gradient(155deg, #ffe4f4, #ffcde7);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.62), 0 14px 26px rgba(155, 36, 102, 0.24);
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.letter-tap-area:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.letter-envelope-stage,
.letter-open-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: opacity 0.55s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.letter-envelope-sealed {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.letter-envelope-body {
  position: relative;
  width: clamp(220px, 44vw, 360px);
  height: clamp(146px, 26vw, 220px);
  border: 3px solid #de5f9e;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff8fd, #ffdff1);
  box-shadow: 0 16px 28px rgba(151, 34, 97, 0.24);
}

.letter-envelope-fold {
  position: absolute;
  top: 50%;
  width: 52%;
  height: 3px;
  background: #e667a7;
  border-radius: 999px;
}

.letter-fold-left {
  left: -1px;
  transform-origin: left center;
  transform: rotate(28deg);
}

.letter-fold-right {
  right: -1px;
  transform-origin: right center;
  transform: rotate(-28deg);
}

.letter-envelope-flap {
  position: absolute;
  width: clamp(220px, 44vw, 360px);
  height: clamp(100px, 18vw, 158px);
  top: calc(50% - clamp(72px, 13vw, 110px));
  clip-path: polygon(0 0, 100% 0, 50% 78%);
  background: linear-gradient(180deg, #ffe9f5, #ffcfe8);
  filter: drop-shadow(0 5px 2px rgba(162, 46, 104, 0.16));
}

.letter-seal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(42px, 8vw, 64px);
  height: clamp(42px, 8vw, 64px);
  transform: translate(-50%, 22%);
  border-radius: 999px;
  border: 2px solid #d54692;
  background: radial-gradient(circle at 30% 28%, #ffb7df, #ff4ba4 72%);
  box-shadow: 0 8px 14px rgba(148, 34, 95, 0.36);
  color: #fff9fd;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(12px, 2vw, 18px);
  display: grid;
  place-items: center;
  animation: letterSealBeat 1.25s ease-in-out infinite;
}

.letter-open-stage {
  opacity: 0;
  transform: translate(-50%, -40%) scale(0.92);
}

.letter-paper {
  width: min(620px, 84%);
  min-height: clamp(220px, 40vh, 380px);
  border: 2px solid #f173b6;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 243, 250, 0.95)),
    repeating-linear-gradient(
      180deg,
      rgba(240, 149, 197, 0.16) 0 1px,
      transparent 1px 31px
    );
  box-shadow: 0 14px 28px rgba(148, 34, 95, 0.28);
  padding: clamp(16px, 2.4vw, 24px) clamp(14px, 2.3vw, 20px);
  text-align: left;
  position: relative;
}

.letter-paper::before {
  content: "My Love,";
  display: block;
  font-family: "Great Vibes", cursive;
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 0.92;
  color: #ff4ea6;
  text-shadow: 0 4px 12px rgba(255, 129, 191, 0.36);
  margin-bottom: 10px;
}

.letter-typed-text {
  margin: 0;
  min-height: clamp(130px, 28vh, 200px);
  color: #7a315d;
  font-size: clamp(17px, 2.5vw, 24px);
  line-height: 1.32;
  white-space: pre-line;
  word-break: break-word;
}

.letter-typed-text::after {
  content: "|";
  margin-left: 4px;
  color: #ff4ea6;
  animation: letterCursorBlink 0.8s steps(1, end) infinite;
}

.letter-tap-area.is-finished .letter-typed-text::after {
  opacity: 0;
  animation: none;
}

.letter-tap-area.is-open .letter-envelope-sealed {
  opacity: 0;
  transform: translate(-50%, -68%) scale(0.84) rotateX(52deg);
}

.letter-tap-area.is-open .letter-open-stage {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.letter-close-btn {
  margin-top: 12px;
  min-width: 160px;
  border: 2px solid #8a2f67;
  background: linear-gradient(180deg, #fff7fc, #ffdff1);
  color: #742d5b;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #d36aa5, 0 8px 18px rgba(169, 46, 113, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.letter-close-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.letter-close-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #d36aa5;
}

@keyframes letterSealBeat {
  0%,
  100% {
    transform: translate(-50%, 22%) scale(1);
  }
  50% {
    transform: translate(-50%, 22%) scale(1.08);
  }
}

@keyframes letterCursorBlink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.puzzle-popup {
  position: fixed;
  inset: 0;
  z-index: 1228;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.5vw, 28px);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 246, 252, 0.9) 0 14%, transparent 35%),
    radial-gradient(circle at 82% 78%, rgba(255, 203, 233, 0.88) 0 17%, transparent 38%),
    linear-gradient(155deg, rgba(255, 156, 209, 0.94), rgba(255, 116, 186, 0.94));
  backdrop-filter: blur(6px);
}

.puzzle-popup-card {
  width: min(920px, 96vw);
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  text-align: center;
  animation: rosePop 0.34s cubic-bezier(0.2, 0.75, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.puzzle-title {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-size: clamp(52px, 7.6vw, 84px);
  line-height: 0.9;
  color: #e94d9e;
  text-shadow: 0 6px 20px rgba(231, 104, 170, 0.62), 0 1px 0 #fff;
}

.puzzle-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(15px, 2.3vw, 21px);
}

.puzzle-board {
  width: min(700px, 88vw);
  aspect-ratio: 1 / 1;
  border: 3px solid #f16caf;
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.75), rgba(255, 232, 245, 0.86)),
    repeating-linear-gradient(
      45deg,
      rgba(255, 178, 223, 0.2) 0 10px,
      rgba(255, 239, 250, 0.2) 10px 20px
    );
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.62), 0 14px 26px rgba(155, 36, 102, 0.24);
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
}

.puzzle-tile,
.puzzle-empty {
  border-radius: 12px;
}

.puzzle-tile {
  border: 2px solid #f26daf;
  background-repeat: no-repeat;
  background-size: 300% 300%;
  image-rendering: pixelated;
  box-shadow: 0 6px 10px rgba(145, 31, 91, 0.25);
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.1s ease;
}

.puzzle-tile:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.puzzle-tile:active {
  transform: translateY(1px);
}

.puzzle-empty {
  border: 2px dashed rgba(236, 99, 170, 0.56);
  background: rgba(255, 255, 255, 0.36);
}

.puzzle-board.is-solved {
  animation: puzzleGlow 1.2s ease-in-out infinite alternate;
}

.puzzle-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.puzzle-btn {
  min-width: 138px;
  border: 2px solid #8a2f67;
  background: linear-gradient(180deg, #fff7fc, #ffdff1);
  color: #742d5b;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #d36aa5, 0 8px 18px rgba(169, 46, 113, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.puzzle-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.puzzle-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #d36aa5;
}

@keyframes puzzleGlow {
  from {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.62), 0 14px 26px rgba(155, 36, 102, 0.24);
    filter: saturate(1);
  }
  to {
    box-shadow:
      inset 0 0 0 2px rgba(255, 255, 255, 0.76),
      0 22px 34px rgba(155, 36, 102, 0.34),
      0 0 24px rgba(255, 213, 118, 0.52);
    filter: saturate(1.08);
  }
}

.gallery-popup {
  position: fixed;
  inset: 0;
  z-index: 1230;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2.5vw, 28px);
  background:
    radial-gradient(circle at 16% 20%, rgba(255, 241, 250, 0.92) 0 15%, transparent 36%),
    radial-gradient(circle at 86% 82%, rgba(255, 196, 230, 0.9) 0 17%, transparent 36%),
    linear-gradient(155deg, rgba(255, 145, 203, 0.95), rgba(255, 108, 181, 0.95));
  backdrop-filter: blur(5px);
}

.gallery-popup-card {
  width: min(980px, 96vw);
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  text-align: center;
  animation: rosePop 0.34s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.gallery-title {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-size: clamp(48px, 7.4vw, 86px);
  line-height: 0.9;
  color: #e94d9e;
  text-shadow: 0 6px 20px rgba(231, 104, 170, 0.62), 0 1px 0 #fff;
}

.gallery-subtitle {
  margin: 2px 0 14px;
  font-family: "Pixelify Sans", monospace;
  font-size: clamp(15px, 2.3vw, 22px);
  color: var(--ink-soft);
}

.ebook-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.ebook-nav {
  width: 44px;
  height: 44px;
  border: 2px solid #8a2f67;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff8fd, #ffdff1);
  color: #7a2f5f;
  font-size: 34px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 0 #d36aa5;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
}

.ebook-nav:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.ebook-nav:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #d36aa5;
}

.ebook-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 3px 0 #d36aa5;
}

.ebook-book {
  position: relative;
  min-height: clamp(320px, 54vh, 500px);
  border-radius: 18px;
  border: 2px solid #ef71b3;
  background: linear-gradient(145deg, #ffd8ed, #ffc2e2);
  box-shadow: 0 16px 28px rgba(156, 34, 103, 0.22);
  overflow: hidden;
  perspective: 1500px;
  transform-style: preserve-3d;
  will-change: transform;
}

.ebook-book::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 16px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(180deg, #f36cae, #d85399);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.36);
  z-index: 6;
}

.ebook-book.is-opening {
  animation: bookOpen 0.42s cubic-bezier(0.2, 0.75, 0.2, 1);
}

.ebook-cover-shell {
  position: absolute;
  inset: 10px;
  z-index: 14;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transform-origin: left center;
  transform-style: preserve-3d;
}

.ebook-cover-front {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  border: 2px solid #f16daf;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.34) 0 18%, transparent 42%),
    linear-gradient(155deg, #ff8ec9, #ff61b2 56%, #ff4ea6);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.34),
    inset -22px 0 26px rgba(137, 29, 86, 0.22),
    0 18px 32px rgba(145, 31, 92, 0.3);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  color: #fff7fd;
}

.ebook-cover-kicker {
  margin: 0;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(8px, 1vw, 11px);
  letter-spacing: 0.3px;
  opacity: 0.95;
}

.ebook-cover-title {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-size: clamp(44px, 5.5vw, 72px);
  line-height: 0.86;
  text-shadow: 0 4px 14px rgba(255, 155, 214, 0.7), 0 1px 0 rgba(255, 255, 255, 0.95);
}

.ebook-cover-sub {
  margin: 0;
  font-size: clamp(13px, 1.8vw, 20px);
  color: #ffe6f5;
}

.ebook-cover-stars {
  display: flex;
  gap: 10px;
  font-size: clamp(16px, 2.3vw, 24px);
  opacity: 0.92;
}

.ebook-book.is-closed::before,
.ebook-book.is-cover-opening::before {
  opacity: 0;
}

.ebook-book.is-closed .ebook-cover-shell {
  opacity: 1;
  transform: rotateY(0deg);
  pointer-events: auto;
}

.ebook-book.is-cover-opening .ebook-cover-shell {
  pointer-events: none;
  animation: coverOpen 0.24s cubic-bezier(0.2, 0.76, 0.22, 1) forwards;
}

.ebook-book.is-open .ebook-cover-shell {
  opacity: 0;
  transform: rotateY(-170deg);
  pointer-events: none;
}

.ebook-book.is-closed .ebook-spread {
  opacity: 0.7;
  filter: saturate(0.92);
}

.ebook-spread {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  bottom: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  transform-style: preserve-3d;
}

.ebook-page-surface {
  position: relative;
  border-radius: 14px;
  border: 2px solid #f48fc7;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 242, 250, 0.92)),
    repeating-linear-gradient(0deg, rgba(239, 180, 218, 0.22) 0 1px, transparent 1px 28px);
  overflow: hidden;
  transform: translateZ(0);
  will-change: transform, opacity;
}

.ebook-page-left {
  box-shadow: inset -10px 0 20px rgba(229, 132, 189, 0.36), 0 8px 14px rgba(153, 38, 102, 0.18);
}

.ebook-page-right {
  box-shadow: inset 10px 0 20px rgba(229, 132, 189, 0.36), 0 8px 14px rgba(153, 38, 102, 0.18);
}

.ebook-page-left::after,
.ebook-page-right::after {
  content: "";
  position: absolute;
  top: 16px;
  bottom: 16px;
  width: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 210, 235, 0.85));
  opacity: 0.58;
  pointer-events: none;
}

.ebook-page-left::after {
  left: -7px;
}

.ebook-page-right::after {
  right: -7px;
}

.ebook-sheet {
  position: absolute;
  inset: 0;
  padding: clamp(10px, 1.8vw, 16px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ebook-sheet-empty {
  justify-content: center;
}

.ebook-page-list {
  margin: 0;
  padding: 0 0 0 16px;
  color: #7f345f;
  font-size: clamp(12px, 1.8vw, 17px);
  line-height: 1.3;
}

.ebook-page-no {
  margin: auto 0 0;
  align-self: flex-end;
  font-family: "Press Start 2P", monospace;
  font-size: clamp(8px, 1vw, 10px);
  color: #8a3a69;
}

.ebook-page-flip-sheet {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% - 6px);
  pointer-events: none;
  transform-style: preserve-3d;
  z-index: 12;
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateZ(0);
  will-change: transform, opacity;
}

.ebook-page-flip-sheet.is-active {
  opacity: 1;
  visibility: visible;
}

.ebook-page-flip-sheet.flip-next {
  left: calc(50% + 6px);
  transform-origin: left center;
  animation: pageFlipNext 0.32s cubic-bezier(0.22, 0.72, 0.2, 1) both;
}

.ebook-page-flip-sheet.flip-prev {
  left: 0;
  transform-origin: right center;
  animation: pageFlipPrev 0.32s cubic-bezier(0.22, 0.72, 0.2, 1) both;
}

.ebook-page-flip-sheet::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 12px;
  right: -4px;
  background: linear-gradient(90deg, rgba(120, 34, 79, 0.28), rgba(120, 34, 79, 0));
  pointer-events: none;
}

.ebook-page-flip-sheet.flip-prev::after {
  left: -4px;
  right: auto;
  background: linear-gradient(-90deg, rgba(120, 34, 79, 0.28), rgba(120, 34, 79, 0));
}

.ebook-flip-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

.ebook-flip-back {
  transform: rotateY(180deg);
}

.ebook-page-flip-sheet .ebook-flip-front {
  opacity: 1;
}

.ebook-page-flip-sheet .ebook-flip-back {
  opacity: 0;
}

.ebook-page-flip-sheet.show-back .ebook-flip-front {
  opacity: 0;
}

.ebook-page-flip-sheet.show-back .ebook-flip-back {
  opacity: 1;
}

.ebook-book.is-turning-next .ebook-page-right,
.ebook-book.is-turning-prev .ebook-page-left {
  visibility: hidden;
}

.ebook-page-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.ebook-page-head span {
  font-family: "Press Start 2P", monospace;
  font-size: 8px;
  color: #8a3467;
}

.ebook-page-head strong {
  font-family: "Pixelify Sans", monospace;
  font-size: clamp(16px, 2.2vw, 24px);
  color: #6f2b56;
}

.ebook-photo-wrap {
  border-radius: 14px;
  border: 2px solid #ff95cd;
  background: linear-gradient(135deg, #ffe5f4, #ffd2ea);
  padding: 6px;
  flex: 1;
  min-height: 0;
}

.ebook-photo {
  width: 100%;
  height: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  box-shadow: 0 10px 18px rgba(129, 30, 83, 0.22);
}

.ebook-note-card {
  border: 2px dashed #e85ea9;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 247, 252, 0.95), rgba(255, 224, 242, 0.92));
  min-height: 112px;
  display: grid;
  place-items: center;
  padding: 12px;
  color: #7a325d;
  font-size: clamp(14px, 2vw, 20px);
  text-align: center;
  line-height: 1.25;
}

.ebook-sticker-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.ebook-sticker {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 2px solid #f276b8;
  background: linear-gradient(180deg, #fff8fd, #ffdff0);
  color: #a63a76;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.ebook-text {
  margin: 0;
  color: #7a315d;
  font-size: clamp(13px, 1.9vw, 18px);
  line-height: 1.2;
}

.ebook-page-photo {
  background: linear-gradient(160deg, rgba(255, 240, 250, 0.9), rgba(255, 220, 240, 0.9));
}

.ebook-page-note {
  background: linear-gradient(160deg, rgba(255, 238, 249, 0.92), rgba(255, 210, 236, 0.9));
}

.ebook-page-music {
  background: linear-gradient(160deg, rgba(241, 246, 255, 0.92), rgba(227, 234, 255, 0.9));
}

.ebook-page-future {
  background: linear-gradient(160deg, rgba(255, 242, 248, 0.94), rgba(255, 222, 241, 0.9));
}

.ebook-page-label {
  margin: 12px 0 0;
  color: #7a315d;
  font-size: clamp(14px, 2vw, 20px);
}

@keyframes bookOpen {
  from {
    transform: scale(0.96) rotateX(6deg);
  }
  to {
    transform: scale(1) rotateX(0);
  }
}

@keyframes coverOpen {
  0% {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }
  100% {
    opacity: 0;
    transform: rotateY(-176deg) translateX(-6px);
  }
}

@keyframes pageFlipNext {
  0% {
    transform: rotateY(0deg);
    opacity: 1;
  }
  100% {
    transform: rotateY(-180deg);
    opacity: 1;
  }
}

@keyframes pageFlipPrev {
  0% {
    transform: rotateY(0deg);
    opacity: 1;
  }
  100% {
    transform: rotateY(180deg);
    opacity: 1;
  }
}

@keyframes pageTurnInFromRight {
  from {
    opacity: 0.2;
    transform: rotateY(115deg) translateX(8px);
  }
  to {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }
}

@keyframes pageTurnInFromLeft {
  from {
    opacity: 0.2;
    transform: rotateY(-115deg) translateX(-8px);
  }
  to {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }
}

@keyframes pageTurnOutToLeft {
  from {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }
  to {
    opacity: 0.05;
    transform: rotateY(-165deg) translateX(-10px);
  }
}

@keyframes pageTurnOutToRight {
  from {
    opacity: 1;
    transform: rotateY(0deg) translateX(0);
  }
  to {
    opacity: 0.05;
    transform: rotateY(165deg) translateX(10px);
  }
}

.gallery-close-btn {
  margin-top: 12px;
  min-width: 168px;
  border: 2px solid #8a2f67;
  background: linear-gradient(180deg, #fff7fc, #ffdff1);
  color: #742d5b;
  font-family: "Press Start 2P", monospace;
  font-size: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 0 #d36aa5, 0 8px 18px rgba(169, 46, 113, 0.25);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.gallery-close-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.gallery-close-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 0 #d36aa5;
}

@media (max-width: 540px) {
  .home-screen {
    place-items: start center;
    padding: 12px 8px;
  }

  .home-card {
    width: 100%;
    padding: 14px 10px;
  }

  .home-card h1 {
    font-size: clamp(14px, 5.2vw, 20px);
    line-height: 1.3;
  }

  .subtitle {
    font-size: clamp(16px, 5vw, 24px);
    line-height: 1.25;
  }

  .couple-wrap {
    aspect-ratio: 1 / 1;
  }

  .game-screen {
    width: 100vw;
    min-height: 100vh;
    padding: 0;
    place-items: center;
  }

  .console-body {
    width: 100vw;
    max-width: 100vw;
    height: auto;
    aspect-ratio: 594 / 881;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    transform: none;
  }

  .rose-close-btn {
    font-size: 9px;
    padding: 9px 10px;
  }

  .rose-title {
    font-size: clamp(44px, 13vw, 64px);
  }

  .rose-subtitle-popup {
    font-size: clamp(14px, 4vw, 18px);
  }

  .rose-popup-card {
    width: 96vw;
    padding: 0;
    border-radius: 0;
    gap: 6px;
  }

  .rose-image-wrap {
    width: 92%;
    padding: 6px;
  }

  .rose-bouquet {
    max-height: 52vh;
  }

  .music-popup-card {
    width: 96vw;
    padding: 0;
    border-radius: 0;
  }

  .music-title {
    font-size: clamp(42px, 12vw, 62px);
  }

  .music-subtitle {
    font-size: clamp(13px, 4.2vw, 17px);
    margin: 4px 0 10px;
  }

  .music-close-btn {
    font-size: 9px;
    padding: 9px 10px;
  }

  .gift-popup-card {
    width: 96vw;
    padding: 0;
    border-radius: 0;
  }

  .gift-title {
    font-size: clamp(36px, 11.5vw, 54px);
    line-height: 0.95;
  }

  .gift-hint {
    font-size: clamp(12px, 3.6vw, 15px);
    margin: 0;
  }

  .gift-tap-area {
    min-height: 61vh;
    width: 100%;
    border-radius: 14px;
  }

  .gift-box-visual {
    width: clamp(160px, 48vw, 250px);
  }

  .gift-tap-area.is-open .gift-box-visual {
    opacity: 0.1;
    transform: translateY(-90px) scale(0.72);
  }

  .gift-ticket-wrap {
    left: 8px;
    right: 8px;
    top: 8px;
    bottom: 8px;
    gap: 8px;
    transform: translateY(18px) scale(0.98);
  }

  .flight-ticket {
    border-radius: 12px;
  }

  .flight-ticket-top {
    padding: 7px 9px;
  }

  .flight-ticket-top strong {
    font-size: clamp(10px, 3vw, 12px);
  }

  .flight-badge {
    font-size: 8px;
    padding: 2px 6px;
  }

  .flight-ticket-main {
    padding: 8px 9px 9px;
  }

  .flight-airline {
    font-size: clamp(10px, 3vw, 12px);
    margin-bottom: 6px;
  }

  .flight-time {
    font-size: clamp(18px, 6.3vw, 24px);
  }

  .flight-city {
    font-size: clamp(9px, 2.8vw, 11px);
  }

  .flight-mid {
    min-width: 72px;
  }

  .flight-mid::before {
    font-size: 14px;
  }

  .flight-duration {
    font-size: clamp(8px, 2.3vw, 10px);
  }

  .flight-stop {
    font-size: clamp(8px, 2.2vw, 9px);
  }

  .gift-tap-area.is-open .gift-ticket-wrap {
    transform: translateY(0) scale(1);
  }

  .gift-close-btn {
    font-size: 8px;
    padding: 8px 10px;
  }

  .letter-popup-card {
    width: 96vw;
    padding: 0;
    border-radius: 0;
  }

  .letter-title {
    font-size: clamp(38px, 11vw, 56px);
    line-height: 0.95;
  }

  .letter-hint {
    font-size: clamp(12px, 3.6vw, 15px);
    margin: 0;
  }

  .letter-tap-area {
    min-height: 61vh;
    width: 100%;
    border-radius: 14px;
  }

  .letter-envelope-body {
    width: clamp(180px, 62vw, 292px);
    height: clamp(118px, 40vw, 196px);
    border-radius: 14px;
  }

  .letter-envelope-flap {
    width: clamp(180px, 62vw, 292px);
    height: clamp(84px, 30vw, 146px);
    top: calc(50% - clamp(58px, 20vw, 98px));
  }

  .letter-seal {
    width: clamp(40px, 14vw, 58px);
    height: clamp(40px, 14vw, 58px);
    font-size: clamp(10px, 3.6vw, 14px);
  }

  .letter-paper {
    width: 92%;
    min-height: 47vh;
    border-radius: 14px;
    padding: 14px 12px;
  }

  .letter-paper::before {
    font-size: clamp(30px, 10.2vw, 46px);
    margin-bottom: 8px;
  }

  .letter-typed-text {
    font-size: clamp(14px, 4.2vw, 18px);
    min-height: 30vh;
    line-height: 1.28;
  }

  .letter-close-btn {
    font-size: 8px;
    padding: 8px 10px;
  }

  .puzzle-popup-card {
    width: 96vw;
    padding: 0;
    border-radius: 0;
  }

  .puzzle-title {
    font-size: clamp(40px, 11vw, 56px);
    line-height: 0.95;
  }

  .puzzle-hint {
    font-size: clamp(12px, 3.6vw, 15px);
  }

  .puzzle-board {
    width: 96vw;
    max-width: 96vw;
    border-radius: 12px;
    padding: 8px;
    gap: 6px;
  }

  .puzzle-tile,
  .puzzle-empty {
    border-radius: 8px;
  }

  .puzzle-btn {
    min-width: 118px;
    font-size: 8px;
    padding: 8px 10px;
  }

  .gallery-popup-card {
    width: 96vw;
    padding: 0;
    border-radius: 0;
  }

  .gallery-title {
    font-size: clamp(40px, 11vw, 58px);
  }

  .gallery-subtitle {
    font-size: clamp(13px, 4vw, 17px);
    margin: 4px 0 10px;
  }

  .ebook-shell {
    grid-template-columns: 34px minmax(0, 1fr) 34px;
    gap: 6px;
  }

  .ebook-nav {
    width: 34px;
    height: 34px;
    font-size: 24px;
  }

  .ebook-book {
    min-height: 282px;
  }

  .ebook-cover-shell {
    inset: 6px;
  }

  .ebook-cover-front {
    border-radius: 10px;
    gap: 6px;
  }

  .ebook-cover-kicker {
    font-size: 6px;
  }

  .ebook-cover-title {
    font-size: clamp(28px, 8.8vw, 42px);
  }

  .ebook-cover-sub {
    font-size: clamp(10px, 2.9vw, 13px);
  }

  .ebook-cover-stars {
    font-size: clamp(12px, 3.6vw, 16px);
    gap: 7px;
  }

  .ebook-book::before {
    width: 12px;
    top: 6px;
    bottom: 6px;
  }

  .ebook-spread {
    left: 6px;
    right: 6px;
    top: 6px;
    bottom: 6px;
    gap: 8px;
  }

  .ebook-page-surface {
    border-radius: 10px;
  }

  .ebook-sheet {
    padding: 8px 7px;
    gap: 6px;
  }

  .ebook-page-list {
    font-size: clamp(10px, 2.8vw, 12px);
    padding-left: 12px;
  }

  .ebook-page-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .ebook-page-head span {
    font-size: 6px;
  }

  .ebook-page-head strong {
    font-size: clamp(12px, 3.9vw, 15px);
  }

  .ebook-photo {
    max-height: 110px;
  }

  .ebook-note-card {
    min-height: 76px;
    font-size: clamp(10px, 3vw, 12px);
    padding: 8px;
  }

  .ebook-sticker {
    width: 24px;
    height: 24px;
    font-size: 13px;
  }

  .ebook-text {
    font-size: clamp(10px, 3vw, 12px);
  }

  .ebook-page-no {
    font-size: 7px;
  }

  .ebook-page-flip-sheet {
    width: calc(50% - 4px);
  }

  .ebook-page-flip-sheet.flip-next {
    left: calc(50% + 4px);
  }

  .ebook-page-label {
    font-size: clamp(11px, 3.3vw, 14px);
  }

  .gallery-close-btn {
    font-size: 9px;
    padding: 9px 10px;
  }
}
