:root {
  color-scheme: dark;
  --ink: #e6d8db;          /* texto principal claro y suave */
  --muted: #9a8a8e;        /* texto secundario más apagado */
  --rose: #a85a68;         /* rosa emo / burdeos desaturado */
  --paper: #1c1618;        /* “papel” oscuro */
  --line: #3a2e31;         /* líneas y bordes */
}
* { box-sizing: border-box; }
body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 12% 8%, #2a1a1e 0, transparent 40%),
    radial-gradient(ellipse at 90% 92%, #241a16 0, transparent 42%),
    #141012;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}
body.image-viewer-open {
  overflow: hidden;
}
.page-flow {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  isolation: isolate;
}
.love-page,
.letter-page,
.timeline-page,
.garden-page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transform: translateY(100%);
  transition:
    transform 700ms cubic-bezier(0.22, 0.75, 0.25, 1),
    opacity 500ms ease,
    visibility 0s linear 700ms;
  touch-action: pan-y;
  will-change: transform, opacity;
}
.screen.is-active {
  z-index: 1;
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s;
}
.screen.is-entering-from-below,
.screen.is-entering-from-above {
  z-index: 2;
  visibility: visible;
  opacity: 1;
  pointer-events: none;
  transition: none;
}
.screen.is-entering-from-below { transform: translateY(100%); }
.screen.is-entering-from-above { transform: translateY(-100%); }
.screen.is-leaving-up,
.screen.is-leaving-down {
  z-index: 2;
  visibility: visible;
  opacity: 0;
  pointer-events: none;
}
.screen.is-leaving-up { transform: translateY(-18%); }
.screen.is-leaving-down { transform: translateY(18%); }
.screen.is-active .letter-card {
  opacity: 1;
  transform: translateY(0);
}
.love-page {
  display: grid;
  place-items: center;
  padding: 32px 18px;
}
.love-card {
  width: min(100%, 760px);
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: clamp(32px, 7vw, 68px);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 30px;
  background: rgb(28 22 24 / 92%);
  box-shadow: 0 24px 80px rgb(0 0 0 / 45%);
  text-align: center;
  animation: card-arrives 1.1s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
.eyebrow,
h1,
.intro,
.heart-button,
.clock,
.since,
.footer {
  animation: content-arrives 0.8s ease-out both;
}
.eyebrow { animation-delay: 0.15s; }
h1 { animation-delay: 0.3s; }
.intro { animation-delay: 0.45s; }
.heart-button { animation-delay: 0.6s; }
.clock { animation-delay: 0.75s; }
.since { animation-delay: 0.9s; }
.footer { animation-delay: 1.05s; }
.eyebrow {
  margin: 0 0 14px;
  color: var(--rose);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 8vw, 4.5rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1.08;
}
.intro {
  margin: 16px 0 34px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}
.heart {
  display: grid;
  width: 58px;
  height: 58px;
  margin: 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #2a1e21;
  color: var(--rose);
  font-size: 1.6rem;
  transition: transform 180ms ease, background-color 180ms ease;
}
.heart-button {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 24px auto 0;
  padding: 0 12px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.heart-button:hover .heart {
  transform: scale(1.06);
  background: #332428;
}
.heart-button[aria-pressed="true"] .heart {
  animation: beat 1.5s ease-in-out infinite;
}
.heart-button:focus-visible {
  border-radius: 12px;
  outline: 2px solid var(--rose);
  outline-offset: 4px;
}
.heart-caption {
  color: var(--rose);
  font-size: 0.82rem;
}
.music-status {
  min-height: 1.2em;
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.78rem;
}
.clock {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(4px, 1.6vw, 14px);
  width: 100%;
  padding: 22px 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #161214;
}
.unit {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.value {
  color: #d4c4c8;
  font-variant-numeric: tabular-nums;
  font-family: "Courier New", monospace;
  font-size: clamp(1rem, 5vw, 2rem);
  font-weight: 600;
  white-space: nowrap;
}
.label {
  color: var(--muted);
  font-size: clamp(0.55rem, 1.8vw, 0.72rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.separator {
  padding-top: 1px;
  color: var(--rose);
  font-family: "Courier New", monospace;
  font-size: clamp(1rem, 5vw, 2rem);
  line-height: 1;
}
.since {
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.footer {
  margin: 20px 0 0;
  color: var(--rose);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.08rem;
  font-style: italic;
}
.scroll-cue,
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--rose);
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}
.scroll-cue {
  margin-top: 34px;
}
.scroll-cue span {
  font-size: 1.15rem;
}
.letter-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0 18px;
  overflow: hidden;
}
.timer-banner {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  width: calc(100% + 36px);
  margin: 0 -18px;
  padding: 12px 18px;
  border-bottom: 1px solid rgb(58 46 49 / 80%);
  background: rgb(22 18 20 / 94%);
  box-shadow: 0 8px 24px rgb(0 0 0 / 35%);
  backdrop-filter: blur(12px);
}
.banner-caption {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.clock-compact {
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  gap: clamp(3px, 0.8vw, 8px);
}
.clock-compact .unit { gap: 2px; }
.clock-compact .value,
.clock-compact .separator { font-size: clamp(0.72rem, 2.3vw, 1rem); }
.clock-compact .label { font-size: clamp(0.42rem, 1.1vw, 0.58rem); }
.letter-card {
  width: min(100%, 760px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  margin: clamp(18px, 4vh, 36px) auto 12px;
  padding: clamp(24px, 5vh, 52px) clamp(30px, 7vw, 66px);
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 30px;
  background: rgb(28 22 24 / 94%);
  box-shadow: 0 24px 80px rgb(0 0 0 / 45%);
}
.letter-card h2 {
  margin: 0 0 28px;
  color: #d4c4c8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 400;
}
.letter-copy {
  color: #b8a8ac;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.9;
}
.letter-copy p {
  margin: 0 0 20px;
}
.letter-copy .signature {
  margin-top: 32px;
  color: var(--rose);
  font-style: italic;
}
.signature span {
  font-style: normal;
}
.letter-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 12px;
}
.back-link {
  width: fit-content;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #161214;
  cursor: pointer;
}
.letter-next {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--rose);
  background: #161214;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.letter-next:disabled {
  color: #6a5a5e;
  background: #1e181a;
  cursor: not-allowed;
}
.timeline-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0 18px;
  overflow: hidden;
}
.timeline-main {
  width: min(100%, 820px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  margin: 0 auto;
  padding: clamp(20px, 4vh, 36px) clamp(4px, 2vw, 18px);
}
.timeline-heading {
  margin-bottom: 26px;
  text-align: center;
}
.timeline-heading h2 {
  margin: 0;
  color: #d4c4c8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 400;
}
.timeline-intro {
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.6;
}
.memories {
  position: relative;
  display: grid;
  gap: 16px;
  margin: 0 0 28px;
  padding: 0 0 0 26px;
  list-style: none;
}
.empty-memories {
  padding: 18px 20px;
  border: 1px dashed #4a383c;
  border-radius: 14px;
  color: var(--muted);
  background: rgb(28 22 24 / 70%);
  line-height: 1.6;
}
.memories::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 7px;
  width: 2px;
  background: #4a3539;
  content: "";
}
.timeline-entry {
  position: relative;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #1a1416;
  box-shadow: 0 10px 28px rgb(0 0 0 / 30%);
}
.timeline-entry.is-important {
  border: 1px solid #c9a84c;
  background: #1f1a14;
  box-shadow:
    0 0 0 1px rgb(201 168 76 / 35%),
    0 0 20px rgb(201 168 76 / 28%),
    0 0 40px rgb(201 168 76 / 12%),
    0 10px 28px rgb(0 0 0 / 30%);
}
.timeline-entry.is-important::before {
  border-color: #141012;
  background: #c9a84c;
  box-shadow: 0 0 12px rgb(201 168 76 / 70%);
}
.timeline-entry.is-important .memory-date {
  color: #e0c56a;
}
.timeline-entry.is-important h3 {
  color: #f0e0b0;
}
.timeline-entry::before {
  position: absolute;
  top: 22px;
  left: -25px;
  width: 12px;
  height: 12px;
  border: 3px solid #141012;
  border-radius: 50%;
  background: var(--rose);
  content: "";
}
.memory-date {
  color: var(--rose);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.timeline-entry h3 {
  margin: 7px 0;
  color: #d4c4c8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 400;
}
.timeline-entry p {
  margin: 0;
  color: #b8a8ac;
  line-height: 1.65;
  white-space: pre-wrap;
}
.memory-image {
  display: block;
  width: 100%;
  max-height: 420px;
  margin-top: 16px;
  border-radius: 12px;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.memory-image:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 24px rgb(0 0 0 / 40%);
}
.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(52px, 8vh, 76px) clamp(16px, 5vw, 64px);
  background: rgb(12 8 10 / 92%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 0s linear 220ms;
}
.image-viewer.is-open {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.image-viewer-photo {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 20px 70px rgb(0 0 0 / 55%);
  cursor: zoom-out;
  transform: scale(0.96);
  transition: transform 220ms ease;
}
.image-viewer.is-open .image-viewer-photo {
  transform: scale(1);
}
.image-viewer-close {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 50%;
  color: white;
  background: rgb(255 255 255 / 10%);
  font: inherit;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}
.image-viewer-close:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}
.letter-next:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 2px;
}
.timeline-controls {
  display: flex;
  justify-content: center;
  padding: 8px 0 12px;
}
@keyframes card-arrives {
  from { opacity: 0; transform: translateY(22px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes content-arrives {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes beat {
  0%, 100% { transform: scale(1); }
  12% { transform: scale(1.09); }
  24% { transform: scale(1); }
  36% { transform: scale(1.06); }
}
@media (max-width: 480px) {
  .love-card { padding: 28px 16px; border-radius: 24px; }
  .heart-button { margin-top: 20px; }
  .music-status { margin-bottom: 12px; }
  .clock { gap: 4px; padding: 20px 4px; }
  .unit { gap: 7px; }
  .value, .separator { font-size: clamp(0.78rem, 4.3vw, 1.2rem); }
  .label { font-size: clamp(0.47rem, 1.7vw, 0.58rem); letter-spacing: 0; }
  .letter-page { padding-right: 12px; padding-left: 12px; }
  .timer-banner { width: calc(100% + 24px); margin-right: -12px; margin-left: -12px; padding: 10px 8px; }
  .clock-compact { gap: 3px; }
  .clock-compact .value, .clock-compact .separator { font-size: clamp(0.68rem, 3.2vw, 0.88rem); }
  .clock-compact .label { font-size: clamp(0.39rem, 1.5vw, 0.5rem); }
  .letter-card { margin-top: 18px; padding: 24px 22px; border-radius: 24px; }
  .letter-card h2 { margin-bottom: 16px; }
  .letter-copy { font-size: 0.98rem; line-height: 1.65; }
  .letter-copy p { margin-bottom: 12px; }
  .letter-copy .signature { margin-top: 20px; }
  .letter-controls { gap: 8px; }
  .letter-next { padding: 8px 11px; font-size: 0.74rem; }
  .timeline-page { padding-right: 12px; padding-left: 12px; }
  .timeline-main { padding: 18px 4px; }
  .timeline-heading { margin-bottom: 18px; }
  .timeline-entry { padding: 15px; }
  .timeline-controls { padding-bottom: 10px; }
  .image-viewer { padding: 64px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .screen,
  .screen.is-entering-from-below,
  .screen.is-entering-from-above {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
/* ===== JARDÍN DE CORAZONES ===== */
.garden-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 0 18px;
  overflow: hidden;
}

.garden-main {
  width: min(100%, 820px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  margin: 0 auto;
  padding: clamp(16px, 3vh, 28px) clamp(4px, 2vw, 18px);
}

.garden-heading {
  margin-bottom: 18px;
  text-align: center;
}

.garden-heading h2 {
  margin: 0;
  color: #d4c4c8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 5.5vw, 2.8rem);
  font-weight: 400;
}

.garden-intro {
  margin: 8px auto 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 420px;
  font-size: 0.92rem;
}

.garden-hud {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.garden-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 100px;
}

.garden-stat span {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.garden-stat strong {
  color: #d4c4c8;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.energy-bar {
  width: 90px;
  height: 8px;
  border-radius: 999px;
  background: #2a1e21;
  overflow: hidden;
  border: 1px solid var(--line);
}

.energy-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #7a3a48, var(--rose));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.garden-plot {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 1 / 1.05;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% 100%, #1f181a 0%, transparent 55%),
    linear-gradient(180deg, #1a1416 0%, #12100f 100%);
  border: 1px solid var(--line);
  box-shadow: inset 0 0 40px rgb(0 0 0 / 40%), 0 16px 48px rgb(0 0 0 / 35%);
  overflow: hidden;
  cursor: crosshair;
  touch-action: manipulation;
}

.garden-plot::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgb(168 90 104 / 8%) 0, transparent 25%),
    radial-gradient(circle at 80% 70%, rgb(168 90 104 / 6%) 0, transparent 30%);
  pointer-events: none;
}

/* Plant / heart stages */
.plant {
  position: absolute;
  width: 52px;
  height: 52px;
  margin-left: -26px;
  margin-top: -26px;
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s ease;
  z-index: 2;
}

.plant:hover {
  transform: scale(1.12);
}

.plant .emoji {
  font-size: 1.6rem;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgb(0 0 0 / 45%));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.plant.stage-0 .emoji { font-size: 1.1rem; opacity: 0.85; }   /* seed */
.plant.stage-1 .emoji { font-size: 1.35rem; }                 /* sprout */
.plant.stage-2 .emoji { font-size: 1.55rem; }                 /* bud */
.plant.stage-3 .emoji {                                       /* bloom */
  font-size: 1.85rem;
  animation: heart-pulse 1.8s ease-in-out infinite;
}

.plant.just-watered .emoji {
  animation: water-bounce 0.45s ease;
}

.plant.is-blooming .emoji {
  animation: bloom-pop 0.7s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

@keyframes heart-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes water-bounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@keyframes bloom-pop {
  0% { transform: scale(0.4); opacity: 0.5; }
  60% { transform: scale(1.25); }
  100% { transform: scale(1); opacity: 1; }
}

/* Floating particles when watering */
.spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rose);
  pointer-events: none;
  animation: spark-fly 0.7s ease-out forwards;
  z-index: 5;
}

@keyframes spark-fly {
  0% { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

.garden-hint {
  margin: 14px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.garden-message {
  margin: 12px auto 0;
  max-width: 380px;
  min-height: 3.2em;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgb(28 22 24 / 80%);
  border: 1px solid var(--line);
  color: #d4c4c8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.garden-message.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.garden-message .from {
  display: block;
  margin-top: 6px;
  color: var(--rose);
  font-size: 0.82rem;
  font-style: italic;
}

@media (max-width: 480px) {
  .garden-page { padding-right: 12px; padding-left: 12px; }
  .garden-main { padding: 14px 4px; }
  .garden-heading { margin-bottom: 12px; }
  .garden-hud { gap: 14px; margin-bottom: 12px; }
  .plant { width: 46px; height: 46px; margin-left: -23px; margin-top: -23px; }
  .plant.stage-3 .emoji { font-size: 1.65rem; }
  .garden-message { font-size: 0.88rem; padding: 10px 12px; }
}