:root {
  --bg: #fff1f6;
  --card: rgba(255, 255, 255, 0.86);
  --text: #351b2d;
  --muted: #7b5a6b;
  --pink: #ff4f93;
  --pink-dark: #df2f78;
  --purple: #7c4dff;
  --shadow: 0 24px 80px rgba(148, 48, 96, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Poppins", Arial, sans-serif;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 9%, rgba(255, 79, 147, 0.32), transparent 32%),
    radial-gradient(circle at 90% 0%, rgba(124, 77, 255, 0.22), transparent 30%),
    linear-gradient(180deg, #fff7fb 0%, #ffe3ef 52%, #fff1f6 100%);
}

button,
input {
  font: inherit;
}

.hearts-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hearts-bg span {
  position: absolute;
  top: -12vh;
  color: rgba(255, 79, 147, 0.42);
  font-size: clamp(1.1rem, 7vw, 2rem);
  opacity: 0.8;
  text-shadow: 0 8px 18px rgba(255, 79, 147, 0.16);
  animation: fall-heart linear infinite;
}

.hearts-bg span:nth-child(1) {
  left: 7%;
  animation-duration: 12s;
  animation-delay: -2s;
}

.hearts-bg span:nth-child(2) {
  left: 16%;
  animation-duration: 15s;
  animation-delay: -8s;
  color: rgba(124, 77, 255, 0.28);
}

.hearts-bg span:nth-child(3) {
  left: 25%;
  animation-duration: 11s;
  animation-delay: -5s;
}

.hearts-bg span:nth-child(4) {
  left: 34%;
  animation-duration: 17s;
  animation-delay: -12s;
  color: rgba(255, 131, 177, 0.34);
}

.hearts-bg span:nth-child(5) {
  left: 43%;
  animation-duration: 13s;
  animation-delay: -1s;
}

.hearts-bg span:nth-child(6) {
  left: 52%;
  animation-duration: 16s;
  animation-delay: -9s;
  color: rgba(124, 77, 255, 0.24);
}

.hearts-bg span:nth-child(7) {
  left: 61%;
  animation-duration: 10s;
  animation-delay: -4s;
}

.hearts-bg span:nth-child(8) {
  left: 70%;
  animation-duration: 14s;
  animation-delay: -10s;
}

.hearts-bg span:nth-child(9) {
  left: 79%;
  animation-duration: 18s;
  animation-delay: -6s;
  color: rgba(255, 131, 177, 0.34);
}

.hearts-bg span:nth-child(10) {
  left: 88%;
  animation-duration: 12s;
  animation-delay: -11s;
}

.hearts-bg span:nth-child(11) {
  left: 95%;
  animation-duration: 15s;
  animation-delay: -3s;
  color: rgba(124, 77, 255, 0.24);
}

.hearts-bg span:nth-child(12) {
  left: 2%;
  animation-duration: 19s;
  animation-delay: -14s;
}

.app {
  position: relative;
  z-index: 1;
  align-items: start;
  min-height: 100dvh;
  display: grid;
  justify-items: center;
  padding: 14px;
  padding-top: max(18px, env(safe-area-inset-top));
  overflow-y: auto;
}

.screen {
  width: 100%;
  display: none;
  animation: pop 0.38s ease;
}

.screen.active {
  display: block;
}

.card {
  position: relative;
  width: 100%;
  min-height: calc(100dvh - 28px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  box-shadow: 0 18px 55px rgba(148, 48, 96, 0.2);
  backdrop-filter: blur(14px);
}

.intro-card {
  min-height: calc(100dvh - 28px);
}

.intro-photo {
  width: 104px;
  height: 104px;
  display: block;
  margin: 23px auto 16px;
  border: 4px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  object-fit: cover;
  object-position: center 35%;
  box-shadow: 0 12px 26px rgba(148, 48, 96, 0.18);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--pink-dark);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.04;
}

h1 {
  max-width: 320px;
  margin-inline: auto;
  font-size: clamp(3.15rem, 18vw, 3.65rem);
}

h2 {
  font-size: clamp(2.05rem, 11vw, 3.1rem);
}

.quality-text,
.helper-text,
.final-joke {
  max-width: 560px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.58;
}

.buttons-area {
  position: relative;
  width: min(100%, 330px);
  min-height: 230px;
  margin: 30px auto 0;
  border-radius: 28px;
}

.btn {
  border: 0;
  border-radius: 999px;
  min-height: 52px;
  padding: 14px 28px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover,
.food-option:hover {
  transform: translateY(-3px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 14px 32px rgba(255, 79, 147, 0.35);
}

.btn-ghost {
  position: absolute;
  top: 22px;
  left: 50%;
  min-width: 128px;
  color: var(--pink-dark);
  background: #fff;
  box-shadow: 0 12px 24px rgba(148, 48, 96, 0.14);
  transform: translateX(8%);
}

#yes-button {
  position: absolute;
  top: 22px;
  right: auto;
  left: 50%;
  min-width: 128px;
  transform: translateX(-108%);
}

.wide {
  width: 100%;
}

.form {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 420px;
  margin: 28px auto 0;
  text-align: left;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  border: 2px solid rgba(255, 79, 147, 0.18);
  min-height: 54px;
  border-radius: 20px;
  padding: 14px 16px;
  color: var(--text);
  background: #fff;
  outline: 0;
}

input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 79, 147, 0.12);
}

.food-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 26px;
}

.food-option {
  min-height: 64px;
  border: 2px solid rgba(255, 79, 147, 0.12);
  border-radius: 20px;
  padding: 0 20px;
  color: var(--text);
  font-weight: 800;
  text-align: left;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(148, 48, 96, 0.1);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.food-option:hover {
  border-color: rgba(255, 79, 147, 0.45);
  box-shadow: 0 18px 34px rgba(148, 48, 96, 0.16);
}

.photo-placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin: 26px auto 0;
  border: 3px dashed rgba(255, 79, 147, 0.35);
  border-radius: 28px;
  padding: 22px;
  color: var(--pink-dark);
  font-weight: 800;
  background:
    linear-gradient(135deg, rgba(255, 79, 147, 0.08), rgba(124, 77, 255, 0.08)),
    #fff;
}

.save-status {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--pink-dark);
  font-size: 0.92rem;
  font-weight: 700;
}

.save-status.error {
  color: #b42318;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fall-heart {
  0% {
    transform: translate3d(0, -12vh, 0) rotate(0deg) scale(0.78);
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  50% {
    transform: translate3d(22px, 52vh, 0) rotate(140deg) scale(1);
  }

  100% {
    transform: translate3d(-18px, 112vh, 0) rotate(320deg) scale(0.88);
    opacity: 0;
  }
}

@media (min-width: 621px) {
  body {
    background:
      radial-gradient(circle at 18% 20%, rgba(255, 79, 147, 0.26), transparent 28%),
      radial-gradient(circle at 84% 12%, rgba(124, 77, 255, 0.18), transparent 26%),
      radial-gradient(circle at 50% 95%, rgba(255, 185, 217, 0.55), transparent 34%),
      var(--bg);
  }

  .app {
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    overflow: hidden;
  }

  .screen {
    width: min(100%, 720px);
  }

  .card {
    min-height: auto;
    display: block;
    padding: clamp(28px, 6vw, 56px);
    background: var(--card);
    border-radius: 36px;
    box-shadow: var(--shadow);
  }

  .intro-card {
    min-height: 520px;
  }

  .intro-photo {
    width: 126px;
    height: 126px;
    margin-bottom: 20px;
    border-width: 5px;
    box-shadow: 0 16px 34px rgba(148, 48, 96, 0.22);
  }

  .eyebrow {
    margin-bottom: 12px;
    font-size: 0.84rem;
    letter-spacing: 0.12em;
  }

  h1 {
    max-width: none;
    font-size: clamp(3rem, 10vw, 6.4rem);
  }

  h2 {
    font-size: clamp(2.1rem, 6vw, 4rem);
  }

  .quality-text,
  .helper-text,
  .final-joke {
    margin-top: 22px;
    font-size: clamp(1rem, 2.5vw, 1.18rem);
    line-height: 1.7;
  }

  .buttons-area {
    width: auto;
    min-height: 178px;
    margin-top: 34px;
    background: transparent;
  }

  .btn {
    min-height: auto;
    padding: 15px 32px;
  }

  #yes-button {
    top: 0;
    right: calc(50% + 12px);
    left: auto;
    min-width: 0;
    transform: none;
  }

  .btn-ghost {
    top: 0;
    left: calc(50% + 12px);
    min-width: 0;
    transform: none;
  }

  .form {
    margin-top: 32px;
  }

  input {
    min-height: auto;
    border-radius: 18px;
  }

  .food-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 32px;
  }

  .food-option {
    min-height: 78px;
    border-radius: 22px;
    padding: 0;
    text-align: center;
  }

  .photo-placeholder {
    min-height: 260px;
    margin-top: 32px;
    padding: 0;
  }

  .hearts-bg span {
    font-size: clamp(1.1rem, 3vw, 2.6rem);
    opacity: 1;
  }
}

@media (max-width: 380px) {
  .card {
    padding: 24px 16px;
  }

  h1 {
    font-size: clamp(2.75rem, 17vw, 3.45rem);
  }

  .buttons-area {
    min-height: 210px;
  }

  .intro-photo {
    width: 92px;
    height: 92px;
  }

  #yes-button,
  .btn-ghost {
    min-width: 112px;
    padding-inline: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
