:root {
  --pink-1: #ff6b9d;
  --pink-2: #ffc1e3;
  --ink: #3a2a35;
  --surface: #fff;
  --radius: 16px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(135deg, #ffe4f1 0%, #ffd6e8 50%, #ffeef7 100%);
  color: var(--ink);
  min-height: 100vh;
}

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.app-header {
  text-align: center;
  margin-bottom: 28px;
}
.app-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0 0 6px;
}
.app-header p {
  margin: 0;
  opacity: 0.75;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

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

.editor {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 8px 30px rgba(255, 107, 157, 0.15);
}

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #ffd6e8;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus {
  border-color: var(--pink-1);
}
.hint {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: 4px;
}

.theme-picker {
  display: flex;
  gap: 10px;
}
.theme-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.theme-swatch:hover { transform: scale(1.1); }
.theme-swatch.active { border-color: var(--ink); }
.theme-swatch.theme-pink { background: linear-gradient(135deg, #ff6b9d, #ffc1e3); }
.theme-swatch.theme-red { background: linear-gradient(135deg, #e63950, #ff8c8c); }
.theme-swatch.theme-sunset { background: linear-gradient(135deg, #ff9966, #ff5e62); }
.theme-swatch.theme-night { background: linear-gradient(135deg, #2c3e6b, #8e6bb5); }
.theme-swatch.theme-lavender { background: linear-gradient(135deg, #b088f9, #e0c3fc); }

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.btn {
  flex: 1;
  min-width: 160px;
  padding: 13px 18px;
  border-radius: 12px;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--pink-1);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 107, 157, 0.4);
}
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--pink-1);
}

.share-result {
  margin-top: 14px;
  font-size: 0.9rem;
  word-break: break-all;
}
.share-result a { color: var(--pink-1); font-weight: 600; }

.preview-wrap {
  position: sticky;
  top: 24px;
  display: flex;
  justify-content: center;
}

.card {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 3 / 4;
  border-radius: 20px;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  transition: background 0.4s;
}

.card-decor {
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 14px;
  pointer-events: none;
}

.card-heart {
  font-size: 3rem;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2));
}

.card-to {
  font-family: 'Dancing Script', cursive;
  font-size: 2.2rem;
  margin: 0 0 16px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.card-message {
  font-size: 1.05rem;
  line-height: 1.6;
  color: #fff;
  white-space: pre-wrap;
  margin: 0 0 24px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.card-from {
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  color: #fff;
  margin: 0;
  opacity: 0.95;
}

.theme-pink { background: linear-gradient(145deg, #ff8fb3, #ff6b9d 60%, #c44569); }
.theme-red { background: linear-gradient(145deg, #ff5f6d, #e63950 60%, #8e0e28); }
.theme-sunset { background: linear-gradient(145deg, #ffb677, #ff7e5f 60%, #d6473a); }
.theme-night { background: linear-gradient(145deg, #4b4a8e, #2c3e6b 60%, #161830); }
.theme-lavender { background: linear-gradient(145deg, #d6b4ff, #b088f9 60%, #7a52c9); }

.app-footer {
  text-align: center;
  margin-top: 40px;
  opacity: 0.6;
  font-size: 0.85rem;
}
