:root {
  --rose: #ff74ae;
  --rose-strong: #ff3f8e;
  --violet: #9d68ff;
  --violet-deep: #24113d;
  --gold: #ffd36e;
  --cream: #fff6fb;
  --ink: #fff8fd;
  --glass: rgba(255, 255, 255, 0.13);
  --glass-border: rgba(255, 255, 255, 0.36);
  --shadow: 0 24px 80px rgba(21, 8, 45, 0.42);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow: hidden;
  background: #160b28;
}

body {
  min-height: 100svh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "Cairo", "Tajawal", system-ui, sans-serif;
  background:
    radial-gradient(circle at 50% 8%, rgba(255, 206, 118, 0.2), transparent 28rem),
    radial-gradient(circle at 15% 18%, rgba(255, 116, 174, 0.3), transparent 21rem),
    radial-gradient(circle at 82% 82%, rgba(157, 104, 255, 0.34), transparent 24rem),
    linear-gradient(145deg, #2a1243 0%, #4c1853 42%, #160b28 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  touch-action: manipulation;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell,
.screen {
  position: fixed;
  inset: 0;
  min-height: 100svh;
}

.screen {
  display: grid;
  place-items: center;
  padding: calc(1rem + var(--safe-top)) 1rem calc(1rem + var(--safe-bottom));
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.04);
  transition:
    opacity 850ms ease,
    transform 1000ms cubic-bezier(0.19, 1, 0.22, 1),
    visibility 850ms ease;
}

.screen.is-visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.intro-screen::before,
.surprise-screen::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0) 0 35%, rgba(255, 255, 255, 0.12) 48%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.1), transparent 35rem);
  animation: cinematicSweep 9s linear infinite;
  pointer-events: none;
}

.ambient {
  position: absolute;
  width: 17rem;
  aspect-ratio: 1;
  border-radius: 999px;
  filter: blur(2px);
  opacity: 0.58;
  animation: floatGlow 9s ease-in-out infinite;
}

.ambient-one {
  top: 7%;
  right: -6rem;
  background: radial-gradient(circle, rgba(255, 116, 174, 0.55), transparent 68%);
}

.ambient-two {
  bottom: 4%;
  left: -6rem;
  background: radial-gradient(circle, rgba(157, 104, 255, 0.52), transparent 70%);
  animation-delay: -3s;
}

.ambient-three {
  top: 52%;
  right: 11%;
  width: 10rem;
  background: radial-gradient(circle, rgba(255, 211, 110, 0.42), transparent 70%);
  animation-delay: -5s;
}

.secret-card {
  position: relative;
  z-index: 2;
  width: min(100%, 27rem);
  padding: clamp(1.25rem, 5vw, 2rem);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 1.75rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  contain: layout paint;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: cardArrival 900ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.secret-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background: conic-gradient(from var(--spin, 0deg), var(--rose), var(--gold), var(--violet), var(--rose));
  filter: blur(10px);
  opacity: 0.6;
  animation: borderSpin 5s linear infinite;
}

.card-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 5%, rgba(255, 255, 255, 0.18), transparent 40%);
  transform: translateX(120%);
  animation: shinePass 5s ease-in-out infinite;
  pointer-events: none;
}

.soft-kicker {
  margin: 0 0 0.35rem;
  color: rgba(255, 236, 247, 0.78);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0;
}

.secret-card h1 {
  margin: 0 0 1.35rem;
  color: #ffffff;
  font-size: clamp(1.65rem, 8vw, 2.35rem);
  line-height: 1.25;
  text-shadow: 0 0 26px rgba(255, 116, 174, 0.45);
}

.field {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 0.95rem;
}

.field span {
  color: rgba(255, 246, 251, 0.9);
  font-size: 0.98rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 1rem;
  outline: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.field input::placeholder {
  color: rgba(255, 246, 251, 0.5);
}

.field input:focus {
  border-color: rgba(255, 211, 110, 0.78);
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 0 0 4px rgba(255, 211, 110, 0.13),
    0 0 24px rgba(255, 116, 174, 0.16);
  transform: translateY(-1px);
}

.field input::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.78;
}

.field {
  position: relative;
}

.field input[readonly] {
  cursor: pointer;
}

.date-field input[readonly] {
  pointer-events: none;
}

.date-field:focus-within input[readonly] {
  border-color: rgba(255, 211, 110, 0.78);
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    0 0 0 4px rgba(255, 211, 110, 0.13),
    0 0 24px rgba(255, 116, 174, 0.16);
}

.native-date-picker {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 3;
  width: 100%;
  height: 3.25rem;
  min-height: 3.25rem;
  padding: 0;
  border: 0;
  color: transparent;
  background: transparent;
  opacity: 0.01;
  cursor: pointer;
  pointer-events: auto;
}

.native-date-picker:focus {
  border: 0;
  box-shadow: none;
  background: transparent;
  transform: none;
}

.glow-button {
  position: relative;
  width: 100%;
  min-height: 3.45rem;
  margin-top: 0.35rem;
  border: 0;
  border-radius: 1.1rem;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--rose-strong), var(--violet) 58%, #ffc95c);
  box-shadow:
    0 16px 36px rgba(255, 63, 142, 0.32),
    0 0 34px rgba(255, 211, 110, 0.2);
  font-size: 1.04rem;
  font-weight: 800;
  isolation: isolate;
  overflow: hidden;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    filter 180ms ease;
}

.glow-button::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: -1;
  border-radius: 0.95rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
}

.glow-button::after {
  content: "";
  position: absolute;
  top: -80%;
  bottom: -80%;
  width: 4.5rem;
  background: rgba(255, 255, 255, 0.42);
  filter: blur(18px);
  transform: rotate(22deg) translateX(11rem);
  animation: buttonShimmer 3s ease-in-out infinite;
}

.glow-button:active {
  transform: scale(0.98);
}

.glow-button:hover {
  filter: brightness(1.06);
  box-shadow:
    0 18px 42px rgba(255, 63, 142, 0.42),
    0 0 44px rgba(255, 211, 110, 0.28);
}

.feedback {
  min-height: 1.55rem;
  margin: 0.85rem 0 0;
  color: #ffe0ef;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
  white-space: pre-line;
  opacity: 0;
  transform: translateY(0.4rem);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
}

.feedback.show {
  opacity: 1;
  transform: translateY(0);
}

.secret-card.shake {
  animation: cardShake 520ms ease;
}

.loading-screen {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 116, 174, 0.24), transparent 18rem),
    linear-gradient(155deg, #22103a, #4e185a 48%, #13091f);
}

.loading-orbit {
  position: relative;
  width: 7.5rem;
  aspect-ratio: 1;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.loading-orbit::before {
  content: "❤️";
  font-size: 2.4rem;
  filter: drop-shadow(0 0 26px rgba(255, 116, 174, 0.8));
  animation: heartBeat 900ms ease-in-out infinite;
}

.loading-orbit span {
  position: absolute;
  inset: var(--inset, 0);
  border: 2px solid transparent;
  border-top-color: var(--gold);
  border-right-color: rgba(255, 116, 174, 0.8);
  border-radius: 999px;
  animation: orbitSpin 1.6s linear infinite;
}

.loading-orbit span:nth-child(2) {
  --inset: 0.7rem;
  animation-duration: 2.1s;
  animation-direction: reverse;
  border-top-color: var(--rose);
}

.loading-orbit span:nth-child(3) {
  --inset: 1.4rem;
  animation-duration: 1.2s;
  border-right-color: var(--violet);
}

.loading-screen p {
  margin: 1.4rem 0 0;
  color: rgba(255, 248, 253, 0.88);
  font-weight: 800;
  text-align: center;
}

.surprise-screen {
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 211, 110, 0.18), transparent 19rem),
    radial-gradient(circle at 18% 74%, rgba(255, 116, 174, 0.22), transparent 20rem),
    radial-gradient(circle at 82% 74%, rgba(157, 104, 255, 0.22), transparent 18rem),
    linear-gradient(180deg, #130925 0%, #2a113d 48%, #170a22 100%);
}

.fireworks-canvas,
.night-glow,
.eid-decor,
.balloons,
.hearts,
.particles,
.confetti-layer,
.sparkle-layer {
  position: absolute;
  inset: 0;
}

.fireworks-canvas {
  z-index: 1;
}

.night-glow {
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 116, 174, 0.16), transparent 19rem),
    linear-gradient(180deg, transparent 0 64%, rgba(255, 211, 110, 0.06));
}

.eid-decor {
  z-index: 3;
  pointer-events: none;
}

.crescent {
  position: absolute;
  top: max(1.1rem, calc(var(--safe-top) + 0.8rem));
  left: clamp(1.1rem, 7vw, 4rem);
  width: clamp(4rem, 18vw, 7rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--gold);
  box-shadow:
    0 0 35px rgba(255, 211, 110, 0.55),
    inset -0.4rem -0.45rem 0 rgba(255, 255, 255, 0.28);
  animation: moonFloat 5.5s ease-in-out infinite;
}

.crescent::after {
  content: "";
  position: absolute;
  width: 86%;
  aspect-ratio: 1;
  right: -16%;
  top: -5%;
  border-radius: 50%;
  background: #180a28;
  box-shadow: inset 1rem 0.6rem 1.2rem rgba(157, 104, 255, 0.1);
}

.star {
  position: absolute;
  color: #fff4c9;
  filter: drop-shadow(0 0 12px rgba(255, 211, 110, 0.8));
  animation: starTwinkle 1.8s ease-in-out infinite;
}

.star-one {
  top: 12%;
  right: 15%;
  font-size: 1.7rem;
}

.star-two {
  top: 24%;
  left: 19%;
  font-size: 1.25rem;
  animation-delay: -0.6s;
}

.star-three {
  bottom: 21%;
  right: 11%;
  font-size: 1.1rem;
  animation-delay: -1.1s;
}

.lantern {
  position: absolute;
  top: max(0.4rem, var(--safe-top));
  width: clamp(3.2rem, 13vw, 4.6rem);
  height: clamp(7rem, 25vw, 9.5rem);
  transform-origin: top center;
  animation: lanternSwing 4.5s ease-in-out infinite;
}

.lantern-left {
  right: clamp(1rem, 7vw, 4rem);
}

.lantern-right {
  left: clamp(1rem, 8vw, 5rem);
  animation-delay: -1.5s;
}

.lantern::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 2.3rem;
  background: linear-gradient(#ffeec0, rgba(255, 238, 192, 0.2));
  transform: translateX(-50%);
}

.lantern span {
  position: absolute;
  left: 50%;
  bottom: 0.45rem;
  width: 78%;
  height: 5.7rem;
  border: 2px solid rgba(255, 231, 157, 0.88);
  border-radius: 1.6rem 1.6rem 1.1rem 1.1rem;
  background:
    linear-gradient(90deg, transparent 18%, rgba(255, 211, 110, 0.32) 19% 22%, transparent 23% 47%, rgba(255, 211, 110, 0.28) 48% 52%, transparent 53% 76%, rgba(255, 211, 110, 0.32) 77% 80%, transparent 81%),
    radial-gradient(circle at 50% 62%, rgba(255, 166, 88, 0.9), rgba(255, 211, 110, 0.08) 48%, rgba(255, 255, 255, 0.04));
  box-shadow:
    0 0 26px rgba(255, 190, 97, 0.5),
    inset 0 0 24px rgba(255, 211, 110, 0.16);
  transform: translateX(-50%);
}

.lantern span::before,
.lantern span::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 50%;
  height: 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 211, 110, 0.75), rgba(255, 246, 206, 0.94));
  transform: translateX(-50%);
}

.lantern span::before {
  top: -0.55rem;
}

.lantern span::after {
  bottom: -0.55rem;
}

.message-wrap {
  position: relative;
  z-index: 6;
  width: min(100%, 52rem);
  max-height: calc(100svh - var(--safe-top) - var(--safe-bottom) - 2rem);
  padding: 1rem;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 211, 110, 0.6) transparent;
  text-align: center;
  animation: messageReveal 1200ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.message-wrap::-webkit-scrollbar {
  width: 0.28rem;
}

.message-wrap::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 211, 110, 0.6);
}

.eid-tag {
  display: inline-grid;
  min-height: 2.2rem;
  place-items: center;
  margin: 0 0 0.65rem;
  padding: 0.2rem 0.9rem;
  border: 1px solid rgba(255, 211, 110, 0.34);
  border-radius: 999px;
  color: #ffeab2;
  background: rgba(255, 211, 110, 0.1);
  box-shadow: 0 0 24px rgba(255, 211, 110, 0.14);
  font-weight: 800;
}

.message-wrap h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.8rem, 15vw, 7.6rem);
  line-height: 1.08;
  font-weight: 800;
  text-shadow:
    0 0 20px rgba(255, 116, 174, 0.78),
    0 0 52px rgba(157, 104, 255, 0.5),
    0 10px 34px rgba(0, 0, 0, 0.28);
  animation:
    messagePulse 2.7s ease-in-out infinite,
    textGlowShift 5s ease-in-out infinite;
}

.typing-line {
  min-height: 4.6rem;
  margin: 1rem auto 0;
  color: rgba(255, 246, 251, 0.92);
  font-size: clamp(1.18rem, 5.4vw, 2rem);
  line-height: 1.65;
  font-weight: 700;
  text-shadow: 0 0 24px rgba(255, 211, 110, 0.22);
}

.typing-line::after {
  content: "";
  display: inline-block;
  width: 0.16rem;
  height: 1.2em;
  margin-inline-start: 0.16rem;
  border-radius: 999px;
  background: var(--gold);
  transform: translateY(0.2em);
  animation: cursorBlink 700ms step-end infinite;
}

.love-letter {
  width: min(100%, 38rem);
  margin: 1.1rem auto 0;
  padding: clamp(0.9rem, 4vw, 1.25rem);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    0 18px 45px rgba(18, 6, 34, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(1rem) scale(0.97);
  transition:
    opacity 700ms ease,
    transform 900ms cubic-bezier(0.19, 1, 0.22, 1);
}

.love-letter.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.letter-lead {
  margin: 0 0 0.55rem;
  color: #ffe7ad;
  font-size: clamp(1rem, 4.5vw, 1.2rem);
  font-weight: 800;
}

.letter-text {
  display: grid;
  gap: 0.48rem;
}

.letter-text p {
  min-height: 1.6em;
  margin: 0;
  color: rgba(255, 248, 253, 0.92);
  font-size: clamp(0.95rem, 4.1vw, 1.15rem);
  line-height: 1.9;
  font-weight: 700;
  text-shadow: 0 0 18px rgba(255, 116, 174, 0.18);
}

.letter-text p::after {
  content: "";
  display: inline-block;
  width: 0.12rem;
  height: 1em;
  margin-inline-start: 0.12rem;
  border-radius: 999px;
  background: rgba(255, 211, 110, 0.85);
  transform: translateY(0.15em);
  opacity: 0;
}

.letter-text p.is-typing::after {
  opacity: 1;
  animation: cursorBlink 700ms step-end infinite;
}

.sound-toggle {
  position: fixed;
  z-index: 10;
  top: calc(0.9rem + var(--safe-top));
  right: 0.9rem;
  width: 3rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition:
    transform 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.sound-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 30px rgba(255, 116, 174, 0.25);
}

.sound-toggle:active {
  transform: scale(0.94);
}

.sound-toggle.is-muted {
  opacity: 0.62;
}

.sound-icon {
  font-size: 1.2rem;
  font-weight: 800;
}

.balloon {
  position: absolute;
  z-index: 4;
  bottom: -8rem;
  width: var(--size);
  height: calc(var(--size) * 1.22);
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.78), transparent 14%),
    linear-gradient(145deg, var(--c1), var(--c2));
  box-shadow: inset -0.7rem -0.8rem 1rem rgba(74, 20, 68, 0.18), 0 0 24px rgba(255, 255, 255, 0.12);
  animation: balloonRise var(--speed) linear infinite;
  animation-delay: var(--delay);
}

.balloon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -0.36rem;
  width: 0;
  height: 0;
  border-inline: 0.35rem solid transparent;
  border-top: 0.55rem solid var(--c2);
  transform: translateX(-50%);
}

.balloon::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4.8rem;
  width: 1px;
  height: 4.8rem;
  background: linear-gradient(rgba(255, 255, 255, 0.56), transparent);
  transform: translateX(-50%);
}

.floating-heart {
  position: absolute;
  z-index: 5;
  bottom: -3rem;
  color: rgba(255, 222, 239, 0.82);
  font-size: var(--size);
  filter: drop-shadow(0 0 10px rgba(255, 116, 174, 0.36));
  animation: heartFloat var(--speed) ease-in infinite;
  animation-delay: var(--delay);
}

.soft-particle {
  position: absolute;
  z-index: 2;
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color);
  box-shadow: 0 0 18px var(--color);
  opacity: 0;
  animation: particleDrift var(--speed) ease-in-out infinite;
  animation-delay: var(--delay);
}

.confetti {
  position: absolute;
  z-index: 7;
  top: -1rem;
  width: 0.62rem;
  height: 0.9rem;
  border-radius: 0.18rem;
  background: var(--color);
  transform: translate3d(0, 0, 0) rotate(0deg);
  animation: confettiFall var(--speed) ease-in forwards;
}

.touch-sparkle {
  position: absolute;
  z-index: 12;
  width: 0.4rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color);
  box-shadow: 0 0 16px var(--color);
  pointer-events: none;
  animation: touchSparkle 780ms ease-out forwards;
}

@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes borderSpin {
  to {
    --spin: 360deg;
  }
}

@keyframes cinematicSweep {
  from {
    transform: translateX(-35%) rotate(0deg);
  }
  to {
    transform: translateX(35%) rotate(0deg);
  }
}

@keyframes floatGlow {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0.8rem, -1.2rem, 0) scale(1.08);
  }
}

@keyframes cardArrival {
  from {
    opacity: 0;
    transform: translateY(1.8rem) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shinePass {
  0%,
  55% {
    transform: translateX(120%);
  }
  80%,
  100% {
    transform: translateX(-120%);
  }
}

@keyframes buttonShimmer {
  0%,
  45% {
    transform: rotate(22deg) translateX(13rem);
  }
  78%,
  100% {
    transform: rotate(22deg) translateX(-14rem);
  }
}

@keyframes cardShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(0.45rem);
  }
  40% {
    transform: translateX(-0.45rem);
  }
  60% {
    transform: translateX(0.25rem);
  }
  80% {
    transform: translateX(-0.2rem);
  }
}

@keyframes heartBeat {
  0%,
  100% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.16);
  }
}

@keyframes orbitSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes moonFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-8deg);
  }
  50% {
    transform: translateY(0.65rem) rotate(-2deg);
  }
}

@keyframes starTwinkle {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

@keyframes lanternSwing {
  0%,
  100% {
    transform: rotate(-4deg);
  }
  50% {
    transform: rotate(4deg);
  }
}

@keyframes messageReveal {
  from {
    opacity: 0;
    transform: translateY(2rem) scale(0.82);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes messageRevealLight {
  from {
    opacity: 0;
    transform: translateY(1.2rem) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes textGlowShift {
  0%,
  100% {
    text-shadow:
      0 0 20px rgba(255, 116, 174, 0.78),
      0 0 52px rgba(157, 104, 255, 0.5),
      0 10px 34px rgba(0, 0, 0, 0.28);
  }
  50% {
    text-shadow:
      0 0 28px rgba(255, 211, 110, 0.7),
      0 0 64px rgba(255, 116, 174, 0.54),
      0 10px 34px rgba(0, 0, 0, 0.28);
  }
}

@keyframes cursorBlink {
  50% {
    opacity: 0;
  }
}

@keyframes balloonRise {
  from {
    transform: translate3d(0, 0, 0) rotate(-3deg);
  }
  to {
    transform: translate3d(var(--sway), calc(-120svh - 10rem), 0) rotate(7deg);
  }
}

@keyframes heartFloat {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.7) rotate(0deg);
  }
  14%,
  78% {
    opacity: 0.86;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--sway), calc(-105svh - 3rem), 0) scale(1.35) rotate(16deg);
  }
}

@keyframes particleDrift {
  0%,
  100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.72);
  }
  30%,
  70% {
    opacity: 0.82;
  }
  50% {
    transform: translate3d(var(--dx), var(--dy), 0) scale(1);
  }
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translate3d(0, -4rem, 0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--x), calc(100svh + 5rem), 0) rotate(var(--rotate));
  }
}

@keyframes touchSparkle {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) scale(0);
  }
}

@media (max-width: 520px) {
  .screen {
    padding-inline: 0.85rem;
  }

  .secret-card {
    border-radius: 1.4rem;
  }

  .field input {
    min-height: 3.35rem;
    font-size: 1rem;
  }

  .native-date-picker {
    height: 3.35rem;
    min-height: 3.35rem;
  }

  .glow-button {
    min-height: 3.65rem;
  }

  .typing-line {
    width: min(100%, 20rem);
  }

  .message-wrap {
    padding-inline: 0.35rem;
    transform: translateY(-1vh);
  }

  .love-letter {
    margin-top: 0.8rem;
    border-radius: 0.9rem;
  }

  .lantern-right {
    display: none;
  }
}

@media (max-width: 640px), (pointer: coarse) {
  .intro-screen::before,
  .surprise-screen::before {
    opacity: 0.45;
    animation-duration: 16s;
  }

  .ambient {
    width: 12rem;
    opacity: 0.36;
    filter: none;
    animation-duration: 13s;
  }

  .secret-card {
    box-shadow:
      0 18px 45px rgba(21, 8, 45, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .secret-card::before {
    background: linear-gradient(135deg, rgba(255, 116, 174, 0.9), rgba(255, 211, 110, 0.7), rgba(157, 104, 255, 0.8));
    filter: blur(4px);
    opacity: 0.32;
    animation: none;
  }

  .card-shine {
    opacity: 0.55;
    animation-duration: 8s;
  }

  .glow-button {
    box-shadow:
      0 12px 28px rgba(255, 63, 142, 0.28),
      0 0 22px rgba(255, 211, 110, 0.14);
  }

  .glow-button::after {
    opacity: 0.45;
    filter: none;
    animation-duration: 5.5s;
  }

  .crescent {
    box-shadow: 0 0 22px rgba(255, 211, 110, 0.38);
  }

  .star,
  .floating-heart {
    filter: none;
  }

  .lantern span {
    box-shadow:
      0 0 16px rgba(255, 190, 97, 0.3),
      inset 0 0 16px rgba(255, 211, 110, 0.1);
  }

  .message-wrap {
    animation: messageRevealLight 900ms cubic-bezier(0.19, 1, 0.22, 1) both;
  }

  .message-wrap h2 {
    animation: textGlowShift 5s ease-in-out infinite;
  }

  .love-letter,
  .sound-toggle {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .love-letter {
    box-shadow:
      0 12px 28px rgba(18, 6, 34, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  .balloon,
  .soft-particle,
  .touch-sparkle {
    box-shadow: none;
  }
}

@media (max-height: 680px) {
  .secret-card {
    padding: 1rem;
  }

  .secret-card h1 {
    margin-bottom: 0.8rem;
    font-size: 1.55rem;
  }

  .field {
    gap: 0.28rem;
    margin-bottom: 0.62rem;
  }

  .field input {
    min-height: 2.85rem;
    padding-block: 0.55rem;
  }

  .native-date-picker {
    height: 2.85rem;
    min-height: 2.85rem;
  }

  .glow-button {
    min-height: 3.1rem;
  }

  .eid-tag {
    margin-bottom: 0.35rem;
  }

  .typing-line {
    min-height: 3.4rem;
    margin-top: 0.55rem;
  }

  .love-letter {
    margin-top: 0.55rem;
    padding: 0.75rem;
  }

  .letter-text {
    gap: 0.28rem;
  }

  .letter-text p {
    line-height: 1.65;
  }
}

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