:root {
  --bg-from: #fff7f3;
  --bg-to: #ffdce7;
  --text: #6e2440;
  --accent: #ff7fa8;
  --transition: 600ms;
}

* {
  box-sizing: border-box;
}

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

html {
  background-color: var(--bg-from);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, var(--bg-from), var(--bg-to));
}

body {
  background-color: var(--bg-from);
  color: var(--text);
  font-family: Rubik, "Segoe UI", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
  transition: color var(--transition) ease, background-color var(--transition) ease;
  padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
}

.is-hidden {
  display: none;
}

.screen {
  position: relative;
  z-index: 1;
  max-width: 34rem;
  margin: 0 auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.card-image {
  width: clamp(180px, 60vw, 300px);
  height: auto;
  border-radius: 24px;
}

.card-text {
  margin: 0;
  font-size: clamp(1.25rem, 1rem + 1.2vw, 1.7rem);
  text-wrap: balance;
}

.romantic {
  margin: 0;
  font-size: 0.95rem;
  opacity: 0.75;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

button {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  min-height: 44px;
}

button.quiet {
  border-color: transparent;
  opacity: 0.55;
  font-size: 0.85rem;
}

button[disabled] {
  opacity: 0.35;
  cursor: default;
}

.note {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.7;
}

.letter {
  max-width: 34rem;
  margin: 0 auto;
  padding: 3rem 0;
}

.fallback-card {
  max-width: 34rem;
  margin: 0 auto 3rem;
  font-size: 1.2rem;
  text-align: center;
}

.scene-backdrop {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 100lvh;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.scene-layer {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 112%;
  max-width: none;
  height: auto;
  object-fit: cover;
  object-position: center bottom;
  transform: translateX(-50%);
}

@media (hover: hover) and (pointer: fine) {
  .scene-layer {
    will-change: transform;
  }
}

.scene-layer--garden-far {
  bottom: 16%;
  max-height: 30svh;
  opacity: 0.7;
}

.scene-layer--garden-mid {
  bottom: 7%;
  max-height: 24svh;
  opacity: 0.85;
}

.scene-layer--garden-near {
  bottom: 0;
  max-height: 28svh;
}

.scene-layer--fog {
  bottom: 11%;
  width: 136%;
  max-height: 26svh;
  opacity: 0.5;
}

.scene-moon {
  width: clamp(70px, 9vw, 130px);
}

.scene-cat {
  width: clamp(110px, 13vw, 190px);
}

.scene-rabbit {
  width: clamp(80px, 9vw, 130px);
}

.scene-moon {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 90px;
}

.scene-cat {
  position: absolute;
  bottom: 2%;
  left: 8%;
  width: 130px;
}

.scene-rabbit {
  position: absolute;
  bottom: 6%;
  right: 14%;
  width: 90px;
}

.scene-panel {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem);
  max-width: 38rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
