:root {
  --bg-1: #120914;
  --bg-2: #220f25;
  --text: #fff7fb;
  --muted: rgba(255, 247, 251, 0.8);
  --card: rgba(255, 255, 255, 0.08);
  --card-border: rgba(255, 255, 255, 0.12);
  --accent: #ff5c94;
  --accent-2: #ff87b0;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  --radius: 28px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(255, 92, 148, 0.12), transparent 35%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  overflow: hidden;
}

.app {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(20px, env(safe-area-inset-top))
    18px
    max(20px, env(safe-area-inset-bottom))
    18px;
  display: grid;
  place-items: center;
}

.card {
  width: 100%;
  max-width: 460px;
  min-height: min(78dvh, 720px);
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.55s ease;
}

.card.active {
  display: flex;
}

.card__content {
  width: 100%;
  padding: 28px 22px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-2);
}

h1, h2 {
  margin: 0;
  line-height: 1.1;
  font-weight: 800;
}

h1 {
  font-size: clamp(32px, 8vw, 48px);
}

h2 {
  font-size: clamp(28px, 7.4vw, 42px);
}

.subtitle,
.photo-caption,
.hint,
.phrase {
  font-size: clamp(17px, 4.2vw, 20px);
  line-height: 1.5;
  color: var(--muted);
}

.subtitle,
.photo-caption {
  margin: 18px 0 0;
}

.button-row {
  display: flex;
  gap: 10px;
  flex-direction: column;
  margin-top: 24px;
}

.btn {
  margin-top: 26px;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font-size: 17px;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 28px rgba(255, 92, 148, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

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

.btn--secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.hint {
  margin: 16px 0 0;
}

.phrase-box {
  position: relative;
  min-height: 140px;
  display: grid;
  place-items: center;
  margin-top: 12px;
}

.phrase {
  position: absolute;
  inset: 0;
  margin: auto;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.phrase.active {
  opacity: 1;
  transform: translateY(0);
}

.final-title {
  font-size: clamp(36px, 9vw, 58px);
}

.heart {
  display: inline-block;
  animation: pulse 1.5s ease-in-out infinite;
}

.photo-frame {
  margin-top: 8px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow);
}

.photo-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 18px;
}

.bg-glow {
  position: fixed;
  width: 240px;
  height: 240px;
  filter: blur(60px);
  opacity: 0.5;
  pointer-events: none;
}

.glow-1 {
  top: 6%;
  left: -30px;
  background: rgba(255, 92, 148, 0.22);
}

.glow-2 {
  right: -40px;
  bottom: 8%;
  background: rgba(255, 135, 176, 0.18);
}

.hearts {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hearts span {
  position: absolute;
  bottom: -30px;
  font-size: 16px;
  opacity: 0.35;
  animation: floatUp linear forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes floatUp {
  from { transform: translateY(0); opacity: 0; }
  15% { opacity: 0.35; }
  to { transform: translateY(-110vh); opacity: 0; }
}

@media (min-width: 420px) {
  .button-row {
    flex-direction: row;
  }
}
