:root {
  --bg1: #ffd6e8;
  --bg2: #ffeef5;
  --card: rgba(255, 255, 255, 0.75);
  --text: #5c1b3f;
  --accent: #ff4f96;
  --accent-dark: #d6337a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, var(--bg2), var(--bg1));
  overflow-x: hidden;
}

main {
  width: min(960px, 92%);
  margin: 2rem auto 4rem;
  position: relative;
  z-index: 1;
}

.card {
  background: var(--card);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 24px;
  padding: 2rem;
  margin-bottom: 1.4rem;
  box-shadow: 0 18px 45px rgba(183, 46, 112, 0.12);
}

.hero {
  text-align: center;
}

.hero-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.intro {
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.9rem;
  opacity: 0.75;
}

h1,
h2,
h3 {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 1.12;
}

h1 span {
  font-family: "Great Vibes", cursive;
  color: var(--accent-dark);
  font-size: 1.1em;
}

h2 {
  font-size: clamp(1.3rem, 2.5vw, 2rem);
}

.btn {
  display: inline-block;
  margin-top: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  text-decoration: none;
  padding: 0.8rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

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

.btn-outline {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid rgba(214, 51, 122, 0.35);
}

.timer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.timer div {
  background: #fff;
  border-radius: 14px;
  text-align: center;
  padding: 0.7rem;
}

.timer strong {
  display: block;
  font-size: clamp(1.2rem, 2.8vw, 2rem);
  color: var(--accent-dark);
}

.timer span {
  font-size: 0.8rem;
  text-transform: uppercase;
  opacity: 0.75;
}

.signature {
  font-family: "Great Vibes", cursive;
  font-size: 1.9rem;
  color: var(--accent-dark);
}

.upload-row {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

#photoPicker {
  display: none;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.8rem;
  min-height: 120px;
  border: 2px dashed rgba(214, 51, 122, 0.25);
  border-radius: 16px;
  padding: 0.8rem;
}

.gallery.drag-over {
  border-color: var(--accent-dark);
  background: rgba(255, 79, 150, 0.06);
}

.photo-card {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
  padding: 0.55rem 0.55rem 0.8rem;
  transform: rotate(calc((var(--r, 0) * 1deg)));
}

.photo-card:nth-child(odd) {
  --r: -1.2;
}

.photo-card:nth-child(even) {
  --r: 1.2;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

.photo-date {
  margin: 0.6rem 0 0;
  text-align: center;
  font-family: "Great Vibes", cursive;
  font-size: 1.35rem;
  color: #7a3658;
}

.empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  width: 100%;
  color: #9e5f7e;
  padding: 1.3rem;
}

.hint {
  opacity: 0.85;
}

footer {
  text-align: center;
  margin: 2rem 1rem 3rem;
  font-size: 0.9rem;
  opacity: 0.8;
}

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

.heart {
  position: absolute;
  bottom: -30px;
  color: rgba(255, 79, 150, 0.45);
  animation: floatUp linear forwards;
}

@keyframes floatUp {
  to {
    transform: translateY(-110vh) rotate(20deg);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  .card {
    padding: 1.2rem;
    border-radius: 18px;
  }

  .timer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.photo-card img {
  cursor: zoom-in;
}

.photo-modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 10, 20, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 20;
}

.photo-modal.open {
  display: flex;
}

.photo-modal img {
  max-width: min(92vw, 520px);
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.photo-modal-close {
  position: absolute;
  top: max(0.8rem, env(safe-area-inset-top));
  right: max(0.8rem, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #7a3658;
  font-size: 1.9rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 430px) {
  main {
    width: 94%;
    margin-top: 1rem;
  }

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

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

  .upload-row {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    padding: 0.6rem;
  }

  .photo-date {
    font-size: 1.15rem;
  }
}