:root {
  --pink1: #ffe2ef;
  --pink2: #fff6fb;
  --accent: #ff4d7d;
  --text: #222;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: radial-gradient(circle at top, var(--pink1), var(--pink2));
  overflow-x: hidden;
}

/* floating hearts layer */
.hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.hearts::before, .hearts::after {
  content: "💗 💖 💕 💞 💓 💗 💖 💕 💞 💓";
  position: absolute;
  left: 0;
  right: 0;
  top: 110%;
  font-size: 22px;
  opacity: 0.25;
  animation: floatUp 14s linear infinite;
  white-space: nowrap;
  transform: translateX(-10%);
}
.hearts::after {
  opacity: 0.18;
  font-size: 18px;
  animation-duration: 19s;
  transform: translateX(-35%);
}

@keyframes floatUp {
  from { top: 110%; }
  to   { top: -20%; }
}

.screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.hidden { display: none; }

.card {
  width: min(560px, 92vw);
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 14px 50px rgba(0,0,0,0.09);
}

h1 { margin: 0 0 6px; font-size: 36px; }
.subtitle { margin: 0 0 18px; opacity: 0.75; }

.form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 14px; }
input {
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,0.12);
  background: white;
  font-size: 15px;
}

button {
  margin-top: 6px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}
button:active { transform: translateY(1px); }

.msg { margin: 0; min-height: 20px; }
.tiny { margin: 12px 0 0; opacity: 0.65; font-size: 12px; }

.top { text-align: center; padding: 28px 18px 0; }
.container { width: min(980px, 94vw); margin: 0 auto; padding: 12px 0 40px; display: grid; gap: 24px; }

.loveletter .paper {
  background: rgba(255,255,255,0.90);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 24px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  line-height: 1.6;
}
.sign { margin-top: 10px; font-weight: 700; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.tile {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
  background: white;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
}
.tile img { width: 100%; height: 220px; object-fit: cover; display: block; }
.tile .cap { padding: 10px 12px; font-size: 14px; opacity: 0.85; }

.modal {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: grid; place-items: center;
  padding: 18px;
  z-index: 2;
}
.modalCard {
  width: min(900px, 96vw);
  background: white;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}
.modalCard img { width: 100%; height: 100%; max-height: 80vh; object-fit: cover; display: block; }
.modalText { padding: 16px; }
.meta { opacity: 0.7; font-size: 13px; }

.close {
  position: absolute; top: 10px; right: 10px;
  width: 42px; height: 42px;
  border-radius: 999px;
  background: rgba(255,255,255,0.85);
  color: #222;
  font-size: 24px;
  line-height: 0;
  border: 1px solid rgba(0,0,0,0.08);
}

@media (max-width: 820px) {
  .modalCard { grid-template-columns: 1fr; }
}
