:root {
  --bg: #0f0f14;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);
  --accent: #ff4d7d;
  --accent2: #ffb3c7;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top, #1a0f18, var(--bg));
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  width: min(980px, 92%);
  margin: 0 auto;
  padding: 42px 0 80px;
}

.hero {
  background: linear-gradient(135deg, rgba(255, 77, 125, 0.14), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 40px 28px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  position: relative;
}

.tag {
  display: inline-block;
  background: rgba(255, 77, 125, 0.18);
  border: 1px solid rgba(255, 77, 125, 0.35);
  color: var(--accent2);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.05;
  margin-bottom: 14px;
}

.subtitle {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  max-width: 60ch;
  margin-bottom: 18px;
}

.hero-actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.tiny-note{
  margin-top: 10px;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
}

.section { margin-top: 44px; }

.section h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.muted {
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 850px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}

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

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 77, 125, 0.35);
}

.card .emoji {
  font-size: 24px;
  margin-bottom: 10px;
}

.card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.card p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.btn {
  background: linear-gradient(135deg, var(--accent), #ff2f68);
  border: none;
  color: white;
  padding: 12px 16px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 650;
  box-shadow: 0 10px 22px rgba(255, 77, 125, 0.22);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.03); }

.btn.small {
  padding: 10px 14px;
  border-radius: 12px;
}

.btn.ghost{
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: none;
}

.btn.ghost:hover{
  border-color: rgba(255, 77, 125, 0.35);
}

.memory-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#memoryText {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
}

.memory-controls { display: flex; gap: 10px; }

.final { text-align: center; margin-top: 54px; }

.signature {
  margin-top: 12px;
  font-weight: 700;
  color: var(--accent2);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 50;
}

.modal.hidden { display: none; }

.modal-content {
  width: min(720px, 96%);
  background: rgba(15, 15, 20, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  padding: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  max-height: 86vh;
  overflow: auto;
}

.modal-content h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.modal-content p {
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 12px;
}

.modal-actions{
  margin-top: 14px;
  display:flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.divider{
  height: 1px;
  background: rgba(255,255,255,0.10);
  margin: 14px 0;
}

/* Lock form */
.lock-wrap{
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 14px;
}

.lock-row{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}

.input{
  flex: 1;
  min-width: 220px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.9);
  padding: 12px 14px;
  border-radius: 14px;
  outline: none;
}

.input:focus{
  border-color: rgba(255, 77, 125, 0.45);
}

.error{
  color: rgba(255, 180, 200, 0.95);
  font-size: 13px;
  margin-top: 8px;
}

/* Shake animation on wrong password */
.shake {
  animation: shake 0.35s ease;
}
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

/* Photo gallery */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 850px) {
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.photo {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  aspect-ratio: 4 / 5;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.photo:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 77, 125, 0.35);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.05);
}

.photo-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.16);
  color: rgba(255,255,255,0.88);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  backdrop-filter: blur(8px);
}

.photo-modal-img {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 10px;
}

/* Floating hearts */
.hearts-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.heart {
  position: absolute;
  bottom: -20px;
  font-size: 18px;
  opacity: 0.75;
  animation: floatUp linear forwards;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35));
}

@keyframes floatUp {
  from {
    transform: translateY(0) translateX(0) scale(1);
    opacity: 0.0;
  }
  10% { opacity: 0.7; }
  to {
    transform: translateY(-110vh) translateX(40px) scale(1.15);
    opacity: 0;
  }
}