* {
  box-sizing: border-box;
}

:root {
  --bg-1: #fff0f6;
  --bg-2: #f6e7ff;
  --bg-3: #ffe8d6;
  --text: #44233a;
  --muted: #8b6479;
  --pink: #ff5fa2;
  --pink-dark: #d83f86;
  --cream: rgba(255, 255, 255, 0.72);
  --stroke: rgba(255, 255, 255, 0.72);
  --shadow: 0 28px 80px rgba(150, 68, 113, 0.28);
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 10%, #ffffff 0 8%, transparent 28%),
    radial-gradient(circle at 80% 20%, #ffd0e4 0 10%, transparent 32%),
    linear-gradient(135deg, var(--bg-1), var(--bg-2) 48%, var(--bg-3));
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vh, 32px) 16px;
}

.card {
  position: relative;
  width: min(720px, 100%);
  padding: clamp(26px, 5vw, 58px);
  overflow: hidden;
  text-align: center;
  border: 1px solid var(--stroke);
  border-radius: 42px;
  background: var(--cream);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  filter: blur(16px);
  opacity: 0.38;
  pointer-events: none;
}

.glow-one {
  left: -80px;
  top: -80px;
  background: #ff8abd;
}

.glow-two {
  right: -90px;
  bottom: -100px;
  background: #ffc36a;
}

.eyebrow {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  color: var(--pink-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
  font-size: clamp(36px, 7vw, 68px);
  line-height: 0.92;
  letter-spacing: -0.06em;
}

.subtitle {
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 22px auto 34px;
  color: var(--muted);
  font-size: clamp(16px, 2.4vw, 19px);
  line-height: 1.55;
}

.upload-form {
  position: relative;
  z-index: 1;
}

.start-screen {
  position: relative;
  z-index: 1;
}

.start-screen.hidden {
  display: none;
}

.dropzone {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 28px;
  cursor: pointer;
  border: 2px dashed rgba(216, 63, 134, 0.32);
  border-radius: 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.66), rgba(255,255,255,0.34)),
    rgba(255, 255, 255, 0.4);
  transition: 180ms ease;
}

.dropzone:hover,
.dropzone.dragover {
  transform: translateY(-2px);
  border-color: rgba(216, 63, 134, 0.72);
  box-shadow: 0 18px 40px rgba(216, 63, 134, 0.14);
}

.dropzone input {
  display: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin-bottom: 16px;
  color: white;
  font-size: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff77ad, #ff4d95);
  box-shadow: 0 16px 35px rgba(255, 79, 150, 0.34);
}

.drop-title {
  display: block;
  margin-bottom: 7px;
  font-size: 24px;
  font-weight: 800;
}

.drop-text {
  color: var(--muted);
  font-size: 15px;
}

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease, opacity 160ms ease;
}

.btn:disabled,
.btn.disabled {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-main {
  min-width: 190px;
  padding: 17px 30px;
  color: white;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.02em;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  box-shadow: 0 18px 36px rgba(216, 63, 134, 0.34);
}

.btn-heart {
  width: 58px;
  height: 58px;
  color: var(--pink-dark);
  font-size: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 30px rgba(150, 68, 113, 0.18);
}

.btn-heart.is-timer {
  width: auto;
  min-width: 82px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.love-note {
  position: relative;
  z-index: 1;
  display: inline-block;
  max-width: 480px;
  margin-top: 20px;
  padding: 14px 18px;
  color: #7a325f;
  font-weight: 700;
  line-height: 1.45;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.64);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: 220ms ease;
  pointer-events: none;
}

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

.result {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  padding: 22px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.62);
}

.result.hidden {
  display: none;
}

.result-image {
  position: relative;
  display: grid;
  place-items: center;
  width: min(210px, 72vw);
  aspect-ratio: 3 / 4;
  margin: 0 auto 16px;
  overflow: hidden;
  color: rgba(122, 50, 95, 0.78);
  border: 10px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 26%, rgba(255, 255, 255, 0.85) 0 9%, transparent 10%),
    radial-gradient(circle at 50% 40%, rgba(216, 63, 134, 0.24) 0 12%, transparent 13%),
    linear-gradient(160deg, rgba(255, 160, 200, 0.9), rgba(255, 235, 208, 0.95) 56%, rgba(246, 231, 255, 0.94));
  box-shadow: 0 18px 36px rgba(150, 68, 113, 0.18);
}

.result-image::before {
  content: "";
  position: absolute;
  inset: auto -18% -8% -18%;
  height: 46%;
  border-radius: 50% 50% 0 0;
  background: rgba(255, 255, 255, 0.38);
}

.result-image::after {
  content: "♡";
  position: absolute;
  right: 16px;
  bottom: 12px;
  color: rgba(216, 63, 134, 0.44);
  font-size: 34px;
}

.result-image img {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-image.has-image {
  background: rgba(255, 255, 255, 0.72);
}

.result-image.has-image::before,
.result-image.has-image::after {
  display: none;
}

.result-image.has-image img {
  display: block;
}

.result-image.has-image span {
  display: none;
}

.result-image span {
  position: relative;
  z-index: 1;
  max-width: 130px;
  font-weight: 800;
  line-height: 1.25;
}

.result-meta {
  margin: -2px auto 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.result h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -0.04em;
}

.result-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-secondary {
  min-width: 190px;
  padding: 17px 26px;
  color: var(--pink-dark);
  font-size: 17px;
  font-weight: 900;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 30px rgba(150, 68, 113, 0.18);
}

.flying-heart {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9999;
  pointer-events: none;
  color: var(--heart-color, #ff4d95);
  font-size: var(--heart-size, 20px);
  line-height: 1;
  text-shadow: 0 8px 18px rgba(216, 63, 134, 0.24);
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

@media (min-width: 760px) and (max-height: 820px) {
  body {
    overflow-y: hidden;
  }

  .app {
    min-height: 100svh;
    padding: 10px 16px;
  }

  .card {
    width: min(660px, 100%);
    max-height: calc(100svh - 20px);
    padding: clamp(20px, 4vh, 34px);
    border-radius: 34px;
  }

  .eyebrow {
    margin-bottom: 8px;
    font-size: 11px;
  }

  h1 {
    font-size: clamp(34px, 6.4vh, 54px);
  }

  .subtitle {
    margin: 14px auto 20px;
    font-size: 15px;
    line-height: 1.42;
  }

  .dropzone {
    min-height: clamp(130px, 24vh, 180px);
    padding: 18px;
    border-radius: 26px;
  }

  .drop-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
    font-size: 32px;
  }

  .drop-title {
    font-size: 21px;
  }

  .actions {
    margin-top: 16px;
  }

  .btn-main {
    padding: 14px 28px;
  }

  .btn-heart {
    width: 52px;
    height: 52px;
  }

  .love-note {
    margin-top: 14px;
    padding: 11px 16px;
  }

  .result {
    margin-top: 16px;
    padding: 14px;
  }

  .result-actions {
    gap: 10px;
  }

  .btn-secondary {
    min-width: 160px;
    padding: 14px 22px;
  }

  .result-image {
    width: min(150px, 42vh);
  }
}

@media (max-width: 520px) {
  .card {
    border-radius: 30px;
  }

  .dropzone {
    min-height: 190px;
    border-radius: 26px;
  }

  .actions {
    gap: 10px;
  }

  .btn-main {
    min-width: 160px;
  }

  .result-actions {
    flex-direction: column;
  }

  .download-button,
  .btn-secondary {
    width: 100%;
    max-width: 260px;
  }
}
