.letter {
  background:
    repeating-linear-gradient(transparent, transparent 31px, var(--surface-line) 32px),
    var(--surface);
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% - 40px);
  max-width: 560px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  border-radius: 14px;
  padding: 40px 40px 34px;
  box-shadow: 0 26px 60px var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(0.96);
  transition: opacity 0.7s ease, transform 0.7s ease;
  border: 1px solid var(--border-soft);
}
.letter.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.letter::before {
  content: "✿";
  position: absolute;
  top: 14px; right: 20px;
  color: var(--petal);
  font-size: 22px;
}

.greeting {
  font-size: 16px;
  letter-spacing: 0.5px;
  color: var(--accent);
  margin-bottom: 6px;
}

.date-label {
  font-size: 13px;
  color: var(--text-muted);
  opacity: 0.85;
  margin-bottom: 18px;
}

.letter h1 {
  font-size: 28px;
  color: var(--accent-strong);
  font-style: italic;
  margin-bottom: 18px;
}

.letter .body {
  font-size: 18px;
  line-height: 1.85;
  white-space: pre-wrap;
  min-height: 150px;
}

.cursor {
  display: inline-block;
  width: 2px;
  background: var(--accent-strong);
  margin-left: 1px;
  animation: caret 0.8s steps(1) infinite;
}

.sign {
  margin-top: 22px;
  text-align: right;
  font-size: 20px;
  color: var(--accent);
  font-style: italic;
  opacity: 0;
  transition: opacity 1s ease;
}
.sign.show { opacity: 1; }

.actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  opacity: 0;
  transition: opacity 1s ease;
}
.actions.show { opacity: 1; }

.btn {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 9px 18px;
  border-radius: 30px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease;
}
.btn:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-1px); }

.surprise-msg {
  margin-top: 16px;
  font-size: 17px;
  font-style: italic;
  color: var(--accent-strong);
  text-align: center;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.6s ease, opacity 0.6s ease, margin 0.6s ease;
}
.surprise-msg.show { max-height: 120px; opacity: 1; margin-top: 18px; }

/* Prev/next note arrows flanking the card */
.note-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 6;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--surface-glass);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-soft);
  color: var(--accent);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, background 0.2s ease, transform 0.15s ease;
}
.note-arrow.show { opacity: 1; pointer-events: auto; }
.note-arrow:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); }
/* Sit just outside the 560px card (half = 280) rather than at screen edges */
.note-arrow-left { left: max(6px, calc(50% - 336px)); }
.note-arrow-right { right: max(6px, calc(50% - 336px)); }
.note-arrow.disabled { opacity: 0.25 !important; pointer-events: none; }

@media (max-width: 700px) {
  .note-arrow { width: 38px; height: 38px; font-size: 22px; }
  .note-arrow-left { left: 6px; }
  .note-arrow-right { right: 6px; }
}
