:root {
  --azul: #3b82f6;
  --cian: #00e5ff;
  --cian-deep: #00bcd4;
  --rosado: #fb7185;
  --morado: #a855f7;
  --rojo: #ef4444;
  --negro: #111111;
  --ink: #2a1830;
  --glass: rgba(255, 255, 255, 0.45);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: "Nunito", sans-serif;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 10% 20%, rgba(0, 229, 255, 0.4), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 10%, rgba(251, 113, 133, 0.45), transparent 50%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(168, 85, 247, 0.35), transparent 55%),
    linear-gradient(160deg, #e0f7ff 0%, #fce7f3 45%, #ede9fe 100%);
  padding-bottom: calc(4.5rem + var(--safe-b));
}

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

.petal {
  position: absolute;
  font-size: 1rem;
  opacity: 0.45;
  animation: fall linear infinite;
}

@keyframes fall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 0; }
  10% { opacity: 0.5; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.15; }
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: calc(0.75rem + var(--safe-t)) 1rem 2rem;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.names {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  animation: rise 0.8s ease both;
  width: 100%;
}

.person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 auto;
}

.person .name,
.names .amp {
  /* Un solo degradado azul → rosado a lo largo de Kharina & David */
  background-image: linear-gradient(
    90deg,
    var(--azul) 0%,
    var(--cian-deep) 35%,
    var(--morado) 65%,
    var(--rosado) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.person .name {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2.1rem, 11vw, 4rem);
  font-weight: 600;
  line-height: 1.05;
}

.person.her .name { background-position: 0% 50%; }
.names .amp { background-position: 50% 50%; }
.person.him .name { background-position: 100% 50%; }

.person .nick {
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.25rem, 5vw, 1.85rem);
  color: #6b4d78;
}

.names .amp {
  font-family: "Great Vibes", cursive;
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  align-self: center;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.scroll-hint {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: #7a5a88;
  animation: bob 2.2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.section { padding: 1.35rem 0 0.5rem; }

.section-title {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.55rem, 6vw, 2.2rem);
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.1rem;
  background: linear-gradient(90deg, var(--cian-deep), var(--morado), var(--rosado));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

@media (min-width: 640px) {
  .counter-grid { grid-template-columns: repeat(6, 1fr); gap: 0.85rem; }
}

.unit {
  text-align: center;
  padding: 0.85rem 0.25rem;
  border-radius: 1rem;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.1);
}

.unit:nth-child(1) { border-bottom: 3px solid var(--azul); }
.unit:nth-child(2) { border-bottom: 3px solid var(--cian); }
.unit:nth-child(3) { border-bottom: 3px solid var(--morado); }
.unit:nth-child(4) { border-bottom: 3px solid var(--rosado); }
.unit:nth-child(5) { border-bottom: 3px solid var(--rojo); }
.unit:nth-child(6) { border-bottom: 3px solid #ec4899; }

.unit .num {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.35rem, 6vw, 2.1rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}

.unit .label {
  margin-top: 0.3rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a5a88;
  font-weight: 700;
}

.btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  padding: 0.85rem 1.2rem;
  min-height: 48px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--morado), var(--rosado), var(--rojo));
  box-shadow: 0 8px 22px rgba(239, 68, 68, 0.25);
  transition: transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}

.btn:active { transform: scale(0.98); }

.btn.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: none;
  width: auto;
  flex: 1;
  min-width: 140px;
}

.who-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.who-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 3px solid #fff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.95rem 0.75rem;
  min-height: 52px;
  border-radius: 999px;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  opacity: 0.7;
  width: 100%;
}

.who-btn:active { transform: scale(0.97); }

.who-btn.kharina {
  background: #f9c5d5;
  color: #7a3d52;
  box-shadow: 0 0 0 3px #f9c5d5, 0 8px 20px rgba(249, 197, 213, 0.45);
}

.who-btn.david {
  background: #b8daf5;
  color: #2a5270;
  box-shadow: 0 0 0 3px #b8daf5, 0 8px 20px rgba(184, 218, 245, 0.45);
}

.who-btn.active {
  opacity: 1;
  transform: scale(1.03);
}

.who-btn.kharina.active {
  box-shadow: 0 0 0 3px #f9c5d5, 0 0 0 6px rgba(249, 197, 213, 0.45), 0 10px 24px rgba(249, 197, 213, 0.7);
}

.who-btn.david.active {
  box-shadow: 0 0 0 3px #b8daf5, 0 0 0 6px rgba(184, 218, 245, 0.45), 0 10px 24px rgba(184, 218, 245, 0.7);
}

.moments {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.moment {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.65rem 0.75rem;
  align-items: start;
  padding: 0.95rem;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.55);
  border-left: 5px solid var(--cian);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  animation: rise 0.4s ease both;
}

.moment.from-david { border-left-color: #7eb8e0; }
.moment.from-kharina { border-left-color: #f4a4bc; }

.moment.has-photo {
  grid-template-columns: 88px 1fr auto;
}

.moment .flower {
  font-size: 1.35rem;
  line-height: 1;
  grid-column: 1;
}

.moment .body { min-width: 0; }

.moment.has-photo .body { grid-column: 2; }
.moment:not(.has-photo) .body { grid-column: 1; }
.moment:not(.has-photo) .flower + .body { grid-column: 1; }

.moment .thumbs {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  grid-row: 1 / span 2;
}

.moment .thumb {
  width: 88px;
  height: 88px;
  border-radius: 0.8rem;
  object-fit: cover;
  display: block;
  cursor: pointer;
}

.moment .thumbs .thumb:not(:first-child) {
  width: 88px;
  height: 52px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 5mm;
  background: rgba(40, 20, 35, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lightbox.open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.85rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  background: #fff;
}

.lightbox-close {
  position: absolute;
  top: calc(5mm + 0.35rem);
  right: calc(5mm + 0.35rem);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  color: #c4a0c8;
  background: rgba(255, 245, 250, 0.95);
  box-shadow: 0 0 0 1px rgba(244, 164, 188, 0.45), 0 6px 16px rgba(0, 0, 0, 0.15);
  -webkit-tap-highlight-color: transparent;
  z-index: 1;
}

.lightbox-close:active {
  color: #9b6b8a;
  transform: scale(0.94);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #6b4d78;
  background: rgba(255, 245, 250, 0.95);
  box-shadow: 0 0 0 1px rgba(244, 164, 188, 0.45), 0 6px 16px rgba(0, 0, 0, 0.15);
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-nav.prev { left: calc(5mm + 0.25rem); }
.lightbox-nav.next { right: calc(5mm + 0.25rem); }
.lightbox-nav:active { transform: translateY(-50%) scale(0.94); }

.moment h3 {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  font-weight: 600;
  word-break: break-word;
}

.moment .when {
  font-size: 0.78rem;
  color: #8a6a96;
  margin-top: 0.15rem;
  font-weight: 600;
}

.moment .by {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  color: white;
}

.moment .by.kharina {
  background: #f9c5d5;
  color: #7a3d52;
}

.moment .by.david {
  background: #b8daf5;
  color: #2a5270;
}

.moment p {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  color: #4a3554;
  line-height: 1.45;
  word-break: break-word;
}

.moments-bar {
  display: flex;
  justify-content: flex-start;
  margin: -0.35rem 0 0.55rem;
  padding-left: 0.15rem;
}

.icon-btn {
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.icon-btn:active { transform: scale(0.94); }

.icon-btn.sort-m {
  background: rgba(255, 255, 255, 0.85);
  color: #6b4d78;
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.3);
}

.moment-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  grid-column: -1;
  grid-row: 1 / -1;
}

.moment .del-m,
.moment .edit-m {
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.moment .del-m {
  background: #f9c5d5;
  color: #7a3d52;
  box-shadow: 0 0 0 1px rgba(249, 197, 213, 0.7);
}

.moment .edit-m {
  background: #b8daf5;
  color: #2a5270;
  box-shadow: 0 0 0 1px rgba(184, 218, 245, 0.7);
}

.moment .del-m:active {
  color: #5c2d3e;
  transform: scale(0.94);
}

.moment .edit-m:active {
  color: #1a364a;
  transform: scale(0.94);
}

.form-row.editing {
  border-color: rgba(244, 164, 188, 0.65);
  box-shadow: 0 0 0 3px rgba(249, 197, 213, 0.35);
}

.form-row .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.empty {
  text-align: center;
  padding: 1.75rem 1rem;
  color: #7a5a88;
  border: 2px dashed rgba(168, 85, 247, 0.35);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.3);
  margin-bottom: 0.85rem;
  font-size: 0.92rem;
}

.form-row {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.1rem;
  padding: 1rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.form-row label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #6b4d78;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-row input,
.form-row textarea {
  width: 100%;
  border: 1px solid rgba(168, 85, 247, 0.3);
  background: rgba(255, 255, 255, 0.85);
  padding: 0.85rem 0.9rem;
  border-radius: 0.85rem;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  resize: vertical;
  -webkit-appearance: none;
  appearance: none;
}

.photo-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.photo-preview-item {
  position: relative;
  width: 72px;
  height: 72px;
}

.photo-preview-item img {
  width: 100%;
  height: 100%;
  border-radius: 0.75rem;
  object-fit: cover;
  border: 2px solid rgba(0, 229, 255, 0.45);
  display: block;
}

.photo-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: #f9c5d5;
  color: #7a3d52;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.field-hint {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #7a5a88;
}

.save-status {
  font-size: 0.85rem;
  text-align: center;
  color: #6b4d78;
}

.save-status.ok { color: #2f6b4f; }
.save-status.warn { color: #9a6b20; }
.save-status.err { color: #a13a4a; }

.map-wrap {
  position: relative;
  border-radius: 1.15rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.1);
  background: rgba(255, 255, 255, 0.45);
}

.places-map {
  width: 100%;
  height: min(52vh, 360px);
  min-height: 240px;
  z-index: 1;
}

.map-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: none;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.map-empty[hidden] { display: none !important; }

.places-map.leaflet-container {
  font-family: inherit;
}

#fileInput { display: none; }

#pickPhoto:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

footer {
  text-align: center;
  padding: 2.5rem 0.5rem 1rem;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.05rem, 4.2vw, 1.45rem);
  font-style: italic;
  line-height: 1.45;
  max-width: 28em;
  margin: 0 auto;
  background: linear-gradient(90deg, var(--cian-deep), var(--morado), var(--rosado));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (min-width: 640px) {
  .wrap { padding: 1rem 1.25rem 3rem; }
  .btn { width: auto; }
  .moment.has-photo { grid-template-columns: 110px 1fr auto; }
  .moment .thumb { width: 110px; height: 110px; }
  .moment .thumbs .thumb:not(:first-child) { width: 110px; height: 64px; }
  .unit { padding: 1.1rem 0.4rem; }
  .places-map { height: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  .petal, .scroll-hint, .unit .num, .person .name { animation: none !important; }
}
.list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.todo-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.9rem 0.95rem;
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.55);
  border-left: 5px solid var(--morado);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  animation: rise 0.4s ease both;
}

.todo-item.done {
  opacity: 0.65;
  border-left-color: #c4a0c8;
}

.todo-item.done .todo-text {
  text-decoration: line-through;
  color: #8a6a96;
}

.todo-check {
  width: 1.35rem;
  height: 1.35rem;
  accent-color: var(--rosado);
  cursor: pointer;
}

.todo-text {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  font-weight: 600;
  word-break: break-word;
  color: var(--ink);
}

.item-del {
  border: none;
  background: rgba(255, 245, 250, 0.85);
  color: #c4a0c8;
  cursor: pointer;
  font-size: 0.95rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  line-height: 1;
  box-shadow: 0 0 0 1px rgba(244, 164, 188, 0.35);
  -webkit-tap-highlight-color: transparent;
}

.item-del:active {
  color: #9b6b8a;
  transform: scale(0.94);
}
