:root {
  --bg: #fff7f4;
  --ink: #2c1e27;
  --muted: #7a6170;
  --rose: #f15f85;
  --rose-dark: #c93661;
  --coral: #ff8f70;
  --green: #2f7d68;
  --paper: rgba(255, 255, 255, 0.78);
  --line: rgba(91, 44, 62, 0.16);
  --shadow: 0 22px 70px rgba(177, 74, 101, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Manrope", Arial, sans-serif;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 143, 112, 0.32), transparent 18rem),
    linear-gradient(180deg, #fff9f5 0%, #ffe6ec 62%, #f7fff9 100%);
  overflow-x: hidden;
}

button,
a {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: min(430px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(18px, env(safe-area-inset-top))
    18px
    max(18px, env(safe-area-inset-bottom));
  position: relative;
  background:
    radial-gradient(circle at 18% 8%, rgba(241, 95, 133, 0.16), transparent 11rem),
    radial-gradient(circle at 92% 22%, rgba(214, 242, 227, 0.72), transparent 12rem);
}

.screen {
  width: 100%;
  min-height: calc(100vh - 36px);
  min-height: calc(100dvh - 36px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  animation: screenIn 0.45s ease both;
}

.screen--active {
  display: flex;
}

.visual {
  position: relative;
  width: min(74vw, 306px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 30px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(255, 219, 225, 0.24)),
    radial-gradient(circle at 34% 28%, rgba(241, 95, 133, 0.22), transparent 10rem),
    radial-gradient(circle at 70% 72%, rgba(255, 143, 112, 0.24), transparent 10rem);
}

.visual::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 23px;
  pointer-events: none;
}

.visual__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  position: relative;
  z-index: 1;
}

.visual__image[src]:not([src=""]) {
  display: block;
}

.visual__fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(241, 95, 133, 0.5);
  font-size: clamp(7rem, 36vw, 12rem);
  font-weight: 800;
  line-height: 1;
  transform: rotate(-8deg);
}

.content {
  width: 100%;
  text-align: center;
}

.step {
  margin: 0 0 12px;
  color: var(--rose-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0 auto;
  max-width: 12.5ch;
  font-size: clamp(2.1rem, 11vw, 3.35rem);
  line-height: 1;
  letter-spacing: 0;
}

.subtitle {
  margin: 16px auto 0;
  max-width: 21rem;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.45;
}

.actions,
.final-actions {
  width: 100%;
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.actions--split {
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.button {
  width: 100%;
  min-width: 0;
  min-height: 68px;
  border: 0;
  border-radius: 22px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  font-size: 1.16rem;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    opacity 0.2s ease;
  user-select: none;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button--primary {
  color: white;
  background: linear-gradient(135deg, var(--rose), var(--coral));
  box-shadow: 0 14px 28px rgba(241, 95, 133, 0.32);
}

.button--secondary {
  margin-top: 18px;
  color: white;
  background: var(--green);
  box-shadow: 0 14px 28px rgba(47, 125, 104, 0.2);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
}

#noButton[data-clicks="1"] {
  transform: scale(0.78);
}

#noButton[data-clicks="2"] {
  transform: scale(0.48);
}

#noButton.is-gone {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.08) rotate(10deg);
}

.date-panel {
  margin-top: 22px;
}

#openDateButton,
#dateNextButton {
  margin-left: auto;
  margin-right: auto;
}

.day-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: thin;
  scroll-snap-type: x mandatory;
}

.day-button,
.time-button {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.day-button {
  min-width: 126px;
  padding: 13px 14px;
  scroll-snap-align: start;
}

.day-button span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 236px;
  overflow: auto;
  padding: 2px;
}

.time-button {
  min-height: 52px;
}

.day-button:hover,
.time-button:hover {
  transform: translateY(-1px);
}

.day-button.is-selected,
.time-button.is-selected {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--rose), var(--coral));
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.food-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.76);
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.food-card:hover {
  transform: translateY(-3px);
  border-color: rgba(241, 95, 133, 0.42);
  box-shadow: 0 16px 32px rgba(177, 74, 101, 0.16);
}

.food-card__image {
  width: 100%;
  aspect-ratio: 1.1;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 143, 112, 0.28), transparent 7rem),
    linear-gradient(135deg, #fff, #ffdfe7);
}

.food-card__title {
  display: block;
  margin-top: 10px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 800;
  text-align: center;
}

.feedback-status {
  min-height: 1.4em;
  margin: 18px auto 0;
  color: var(--rose-dark);
  font-size: 0.95rem;
  font-weight: 800;
}

.feedback-status.is-error {
  color: #9a352c;
}

.heart-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  overflow: hidden;
}

.heart {
  position: absolute;
  left: var(--x);
  top: var(--y);
  color: var(--rose);
  font-size: var(--size);
  line-height: 1;
  animation: heartBurst 0.9s ease-out forwards;
  transform: translate(-50%, -50%);
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heartBurst {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--tx)), calc(-50% + var(--ty)))
      scale(1.35)
      rotate(var(--rot));
  }
}

@media (min-width: 520px) {
  body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
  }

  .app {
    min-height: min(860px, calc(100vh - 48px));
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 34px;
    box-shadow: 0 28px 90px rgba(177, 74, 101, 0.22);
  }

  .screen {
    min-height: min(812px, calc(100vh - 84px));
  }
}

@media (max-height: 720px) {
  .screen {
    justify-content: flex-start;
  }

  .visual {
    width: min(58vw, 248px);
  }

  h1 {
    font-size: clamp(1.9rem, 10vw, 3rem);
  }

  .button {
    min-height: 60px;
  }
}