:root {
  --bg: #fdf8fa;
  --surface: #fffdfd;
  --surface-soft: #fff6f9;
  --ink: #30232a;
  --muted: #7a6670;
  --accent: #d991a7;
  --accent-strong: #c96f8c;
  --accent-soft: #fbe6ee;
  --ok: #2b8d67;
  --radius: 18px;
  --shadow: 0 14px 34px rgba(110, 72, 90, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Avenir Next", "Gill Sans", sans-serif;
  background:
    radial-gradient(circle at 10% -10%, #ffdbe8 0%, transparent 48%),
    radial-gradient(circle at 94% 0%, #ffeef4 0%, transparent 50%),
    linear-gradient(180deg, #fff9fc 0%, #fef7fa 100%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.app {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 20px;
  display: grid;
  gap: 14px;
}

.hero {
  text-align: center;
  padding: 10px 0 4px;
}

.hero h1 {
  color: #7a3e54;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  color: var(--muted);
}

h1 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 6vw, 2.7rem);
  line-height: 1.08;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
  border: 1px solid #f1dce5;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 34px rgba(110, 72, 90, 0.13);
}

.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.value {
  margin: 4px 0 0;
  font-size: clamp(1.35rem, 4vw, 1.95rem);
  font-weight: 700;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
}

form {
  display: grid;
  gap: 8px;
}

.action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

label {
  font-size: 0.88rem;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid #ebd8e0;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 145, 167, 0.24);
}

button {
  border: 0;
  border-radius: 13px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

#sendBtn {
  background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent) 100%);
  color: #fff;
  transition: transform 160ms ease, filter 160ms ease;
}

#sendBtn:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

#readyBtn {
  border: 1px solid #e9ccd7;
}

.ghost {
  background: var(--accent-soft);
  color: #5d1c29;
  transition: background-color 160ms ease;
}

.ghost:hover {
  background: #f8dce7;
}

button:focus-visible {
  outline: 3px solid rgba(201, 111, 140, 0.35);
  outline-offset: 1px;
}

button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.status {
  margin: 10px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.status.ok {
  color: var(--ok);
}

.status.err {
  color: #9f223a;
}

.memories-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: 42vh;
  overflow: auto;
}

li {
  border-radius: 12px;
  background: #fff;
  border: 1px solid #f1dfe7;
  padding: 9px 10px;
  font-size: 0.95rem;
}

.when {
  color: var(--muted);
  font-size: 0.82rem;
}

.heart-burst {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}

.heart {
  position: absolute;
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%) scale(0.2);
  color: var(--accent);
  text-shadow: 0 7px 20px rgba(201, 111, 140, 0.28);
}

.heart.big {
  font-size: 68px;
}

.heart.small {
  font-size: 40px;
}

.heart.mini {
  font-size: 24px;
}

.heart-burst.live {
  opacity: 1;
}

.heart-burst.live .heart.big {
  animation: pulse 0.9s ease-out forwards;
}

.heart-burst.live .heart.small {
  animation: drift-left 1s ease-out forwards;
}

.heart-burst.live .heart.mini {
  animation: drift-right 1.05s ease-out forwards;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.22);
    opacity: 0;
  }
  35% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -58%) scale(1.1);
    opacity: 0;
  }
}

@keyframes drift-left {
  0% {
    transform: translate(-50%, -50%) scale(0.35);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translate(-150%, -140%) scale(1.2) rotate(-12deg);
    opacity: 0;
  }
}

@keyframes drift-right {
  0% {
    transform: translate(-50%, -50%) scale(0.2);
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  100% {
    transform: translate(70%, -160%) scale(1.1) rotate(11deg);
    opacity: 0;
  }
}

@media (max-width: 640px) {
  .app {
    padding: 14px;
    gap: 11px;
  }

  .stats-grid {
    gap: 8px;
  }

  .card {
    padding: 11px;
  }

  .action-row {
    grid-template-columns: 1fr;
  }
}
