/* ═══════════════════════════════════════════
   style.css — Câu Chuyện Của Chúng Mình 💕
   ═══════════════════════════════════════════ */

:root {
  --blush: #F2A7BB;
  --petal: #FFC0CB;
  --mist: #FFF0F5;
  --cream: #FFFAF7;
  --rose-gold: #C9848E;
  --mauve: #9B6B78;
  --ink: #3A2328;
  --soft-ink: #6B4550;

  /* surface tokens */
  --bg-page: #FFFAF7;
  --bg-card: #ffffff;
  --bg-letter-card: #FFFDF9;
  --bg-music-bar: #ffffff;
  --border-card: rgba(255,192,203,0.3);
  --shadow-card: rgba(201,132,142,0.12);
}

/* ─── DARK MODE ─── */
html.dark {
  --cream: #0D0D0D;
  --mist: #1A1A1A;
  --ink: #F5E6EA;
  --soft-ink: #D4A0AE;
  --rose-gold: #F2A7BB;
  --mauve: #F2A7BB;

  --bg-page: #0D0D0D;
  --bg-card: #1A1015;
  --bg-letter-card: #180E12;
  --bg-music-bar: #1A1015;
  --border-card: rgba(242,167,187,0.15);
  --shadow-card: rgba(242,167,187,0.08);
}


/* ─── BÌNH MINH (5:00–7:59) — hồng vàng, vàng mật ong, kem sáng ─── */
html.dawn {
  --blush: #E8946A;
  --petal: #F4B97A;
  --mist: #FFF6EC;
  --cream: #FFFBF4;
  --rose-gold: #C47840;
  --mauve: #A05C38;
  --ink: #2A1808;
  --soft-ink: #5C3218;

  --bg-page: #FFFBF4;
  --bg-card: #FFFDF8;
  --bg-letter-card: #FFFCF6;
  --bg-music-bar: #FFFDF8;
  --border-card: rgba(232,148,106,0.25);
  --shadow-card: rgba(196,120,64,0.1);
}

/* ─── HOÀNG HÔN (17:00–19:59) — cam đất, hồng cháy, tím nhạt ─── */
html.dusk {
  --blush: #D4785A;
  --petal: #E8956A;
  --mist: #2A1520;
  --cream: #1A0E14;
  --rose-gold: #E8956A;
  --mauve: #C4708A;
  --ink: #F5E0D8;
  --soft-ink: #D4A898;

  --bg-page: #1A0E14;
  --bg-card: #251318;
  --bg-letter-card: #221018;
  --bg-music-bar: #251318;
  --border-card: rgba(232,149,106,0.18);
  --shadow-card: rgba(212,120,90,0.12);
}

/* ─── THEME CONTROLS WRAPPER ─── */
.theme-controls {
  position: fixed;
  top: 1.1rem;
  right: 1.2rem;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* ─── 4-MODE THEME TOGGLE ─── */
.theme-toggle {
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,192,203,0.45);
  border-radius: 50px;
  cursor: pointer;
  padding: 4px 5px;
  display: flex;
  align-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.3s, border-color 0.3s;
  box-shadow: 0 2px 12px rgba(201,132,142,0.15);
}
.theme-toggle:hover { background: rgba(255,192,203,0.25); }
html.dark .theme-toggle {
  background: rgba(20,10,15,0.45);
  border-color: rgba(242,167,187,0.3);
}

.toggle-track {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1px;
}

/* Each pip */
.theme-pip {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(155,107,120,0.6);
  transition: color 0.3s;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.theme-pip.active { color: white; }

/* Sliding indicator behind pips */
.toggle-indicator {
  position: absolute;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--petal), var(--blush));
  box-shadow: 0 2px 8px rgba(201,132,142,0.5);
  transition: transform 0.4s cubic-bezier(.34,1.56,.64,1), background 0.4s ease;
  top: 0; left: 0;
  z-index: 0;
}

/* Indicator positions per theme (0=dawn, 1=light, 2=dusk, 3=dark) */
html.dawn  .toggle-indicator { transform: translateX(0px); }
html:not(.dark):not(.dawn):not(.dusk) .toggle-indicator { transform: translateX(27px); }
html.dusk  .toggle-indicator { transform: translateX(54px); }
html.dark  .toggle-indicator { transform: translateX(81px); background: linear-gradient(135deg, #4a1530, #2d0e1e); }

/* Dawn: warm golden sunrise */
html.dawn .toggle-indicator { background: linear-gradient(135deg, #F4B97A, #E8946A); }
/* Dusk: deep sunset */
html.dusk .toggle-indicator { background: linear-gradient(135deg, #E8956A, #C4708A); }

/* Active pip colors */
html:not(.dark):not(.dawn):not(.dusk) .pip-light { color: white; }
html.dawn  .pip-dawn  { color: white; }
html.dusk  .pip-dusk  { color: white; }
html.dark  .pip-dark  { color: rgba(242,167,187,0.95); }

/* ─── BRIGHTNESS TOGGLE BUTTON ─── */
.brightness-toggle-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,192,203,0.4);
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--rose-gold);
  transition: background 0.25s, transform 0.2s, border-color 0.25s;
  box-shadow: 0 2px 12px rgba(201,132,142,0.15);
  flex-shrink: 0;
}
.brightness-toggle-btn:hover { background: rgba(255,192,203,0.3); transform: scale(1.08); }
html.dark .brightness-toggle-btn {
  background: rgba(20,10,15,0.45);
  border-color: rgba(242,167,187,0.25);
}

/* ─── BRIGHTNESS PANEL ─── */
.brightness-panel {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255,255,255,0.22);
  border: 1.5px solid rgba(255,192,203,0.4);
  border-radius: 50px;
  padding: 5px 14px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 14px rgba(201,132,142,0.14);
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-width 0.4s cubic-bezier(0.4,0,0.2,1),
              opacity 0.3s ease,
              padding 0.35s ease;
  padding-left: 0; padding-right: 0;
}
.brightness-panel.open {
  max-width: 220px;
  opacity: 1;
  pointer-events: auto;
  padding: 5px 14px;
}
html.dark .brightness-panel {
  background: rgba(20,10,15,0.5);
  border-color: rgba(242,167,187,0.22);
}

.brightness-label {
  color: var(--rose-gold);
  display: flex; align-items: center;
  flex-shrink: 0;
}

.brightness-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 110px; height: 3px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  background: linear-gradient(90deg,
    var(--blush) var(--bprog, 100%),
    rgba(255,192,203,0.25) var(--bprog, 100%)
  );
  flex-shrink: 0;
}
.brightness-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--petal), var(--blush));
  box-shadow: 0 1px 6px rgba(201,132,142,0.55);
  cursor: pointer;
  transition: transform 0.15s;
}
.brightness-slider::-webkit-slider-thumb:hover { transform: scale(1.25); }
.brightness-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border: none; border-radius: 50%;
  background: var(--blush);
}

.brightness-value {
  font-size: 0.67rem;
  font-family: monospace;
  color: var(--rose-gold);
  width: 2.8rem;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}

/* Brightness filter target */
#brightnessTarget {
  transition: filter 0.3s ease;
}


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
html, html * { transition: background-color 0.6s ease, border-color 0.5s ease, color 0.4s ease, box-shadow 0.5s ease; }
/* exclude animations & transforms from blanket transition */
html .petal, html .bokeh-blob { transition: none; }

body {
  background: var(--bg-page);
  color: var(--ink);
  font-family: 'Lora', Georgia, serif;
  overflow-x: hidden;
}

/* ─── BACKGROUND DEPTH SYSTEM ─── */

/* Layer 0: base image or gradient */
.bg-base {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* 🔧 Thay bằng hình ảnh nếu muốn: */
  /* background: url('images/background.jpg') center/cover no-repeat; */
  background: linear-gradient(160deg, #FFE4EE 0%, #FFF0F5 30%, #FFF8FB 60%, #FFFAF7 100%);
  transition: background 0.4s ease;
}
html.dark .bg-base {
  background: linear-gradient(160deg, #1A0810 0%, #120A0D 40%, #0A0608 100%);
}
html.dawn .bg-base {
  background: linear-gradient(160deg, #FDDFA0 0%, #F9C07A 15%, #FDECD4 50%, #FFF8EC 100%);
}
html.dusk .bg-base {
  background: linear-gradient(160deg, #3D1A28 0%, #5C2030 20%, #2A1020 55%, #1A0E14 100%);
}

/* Layer 1: soft bokeh blobs — far depth */
.bg-bokeh {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.bokeh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0;
  animation: bokeh-drift ease-in-out infinite;
}
@keyframes bokeh-drift {
  0%   { transform: translate(0, 0) scale(1);      opacity: 0; }
  15%  { opacity: 1; }
  50%  { transform: translate(var(--dx), var(--dy)) scale(1.15); opacity: 0.7; }
  85%  { opacity: 1; }
  100% { transform: translate(0, 0) scale(1);      opacity: 0; }
}

/* Layer 2: mid-blur frosted glass overlay */
.bg-frosted {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  background: rgba(255,250,247,0.18);
  transition: background 0.4s ease;
}
html.dark .bg-frosted {
  background: rgba(10,6,8,0.22);
}
html.dawn .bg-frosted {
  background: rgba(255,248,230,0.18);
}
html.dusk .bg-frosted {
  background: rgba(26,14,20,0.25);
}

/* Layer 3: petal canvas — foreground depth */
.petals-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}

/* ── PETALS: 3 size classes for parallax depth ── */
.petal {
  position: absolute;
  opacity: 0;
  animation: petal-fall linear infinite;
  will-change: transform, opacity;
}

/* SVG petal shape via clip-path */
.petal svg {
  display: block;
  filter: drop-shadow(0 2px 4px rgba(201,132,142,0.25));
}

/* Small petals — fast, close layer */
.petal.sm {
  animation-name: petal-fall-sm;
}
/* Medium petals — mid speed */
.petal.md {
  animation-name: petal-fall-md;
}
/* Large petals — slow, far layer, more blur */
.petal.lg {
  animation-name: petal-fall-lg;
  filter: blur(1.5px);
}

@keyframes petal-fall-sm {
  0%   { transform: translateY(-30px) rotate(0deg) translateX(0);   opacity: 0; }
  5%   { opacity: 0.9; }
  95%  { opacity: 0.7; }
  100% { transform: translateY(108vh) rotate(540deg) translateX(var(--sway)); opacity: 0; }
}
@keyframes petal-fall-md {
  0%   { transform: translateY(-40px) rotate(0deg) translateX(0);   opacity: 0; }
  5%   { opacity: 0.75; }
  100% { transform: translateY(108vh) rotate(360deg) translateX(var(--sway)); opacity: 0; }
}
@keyframes petal-fall-lg {
  0%   { transform: translateY(-60px) rotate(0deg) translateX(0);   opacity: 0; }
  8%   { opacity: 0.55; }
  100% { transform: translateY(108vh) rotate(200deg) translateX(var(--sway)); opacity: 0; }
}

/* ─── WELCOME SECTION ─── */
#welcome {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: hidden;
  z-index: 4;
}

.welcome-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.welcome-deco::before {
  content: '';
  position: absolute;
  top: -120px; left: -120px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,192,203,0.25) 0%, transparent 70%);
  border-radius: 50%;
}
.welcome-deco::after {
  content: '';
  position: absolute;
  bottom: -80px; right: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(242,167,187,0.2) 0%, transparent 70%);
  border-radius: 50%;
}

.welcome-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1.2rem 2rem;
  max-width: 680px;
  width: 100%;
}

.heart-icon {
  font-size: clamp(1.8rem, 5vh, 3rem);
  display: block;
  margin-bottom: clamp(0.6rem, 2vh, 1.5rem);
  animation: heartbeat 1.4s ease-in-out infinite;
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.22); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.15); }
  70%       { transform: scale(1); }
}

.welcome-tagline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.95rem, 2.3vw, 1.4rem);
  font-style: italic;
  font-weight: 300;
  color: var(--rose-gold);
  letter-spacing: 0.06em;
  margin-bottom: clamp(0.5rem, 1.5vh, 1.2rem);
  opacity: 0;
  animation: fadeUp 1.2s ease 0.3s forwards;
}

.welcome-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 5.5vw, 4rem);
  font-weight: 300;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: 0.01em;
  opacity: 0;
  animation: fadeUp 1.2s ease 0.7s forwards;
}
.welcome-title {
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.welcome-title em {
  font-style: italic;
  color: var(--mauve);
  white-space: nowrap;
}

.welcome-sub {
  margin-top: clamp(0.5rem, 1.5vh, 1.2rem);
  font-family: 'Playfair Display', serif;
  font-size: clamp(0.85rem, 1.7vw, 0.98rem);
  color: var(--soft-ink);
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.03em;
  opacity: 0;
  animation: fadeUp 1.2s ease 1.1s forwards;
}

.btn-start {
  margin-top: clamp(1.2rem, 3vh, 2.8rem);
  padding: 0.9rem 2.6rem;
  background: linear-gradient(135deg, var(--petal), var(--blush));
  color: white;
  border: none;
  border-radius: 50px;
  font-family: 'Lora', serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(201,132,142,0.35);
  animation: pulse-btn 2s ease-in-out infinite, fadeUp 1s ease 1.5s both;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-start:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 32px rgba(201,132,142,0.5);
}
@keyframes pulse-btn {
  0%, 100% { box-shadow: 0 4px 24px rgba(201,132,142,0.35), 0 0 0 0 rgba(255,192,203,0.5); }
  50%       { box-shadow: 0 4px 24px rgba(201,132,142,0.35), 0 0 0 14px rgba(255,192,203,0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── SCROLL HINT ─── */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  animation: fadeUp 1s ease 2s forwards;
}
.scroll-hint span { font-size: 0.75rem; color: var(--rose-gold); letter-spacing: 0.08em; }
.scroll-hint .arrow { width: 20px; height: 20px; border-right: 2px solid var(--blush); border-bottom: 2px solid var(--blush); transform: rotate(45deg); animation: bounce 1.5s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: rotate(45deg) translateY(0); } 50% { transform: rotate(45deg) translateY(6px); } }

/* ─── DIVIDER ─── */
.section-divider {
  text-align: center;
  padding: 3rem 1rem 1rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-style: italic;
  color: var(--rose-gold);
  letter-spacing: 0.05em;
}
.divider-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin: 0.5rem auto 2.5rem;
  max-width: 400px;
}
.divider-line::before, .divider-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blush), transparent);
}
.divider-line .diamond { color: var(--blush); font-size: 1rem; }

/* ─── TIMELINE SECTION ─── */
#timeline {
  position: relative;
  padding: 2rem 1rem 5rem;
  background: transparent;
  z-index: 4;
}

.timeline-wrap {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--petal), var(--blush), var(--mauve));
  transform: translateX(-50%);
}
@media (max-width: 620px) {
  .timeline-line { left: 20px; }
}

.timeline-item {
  position: relative;
  display: flex;
  width: 100%;
  margin-bottom: 4rem;
  align-items: flex-start;
}

.timeline-item:nth-child(odd)  { flex-direction: row; }
.timeline-item:nth-child(even) { flex-direction: row-reverse; }

.timeline-card {
  width: calc(50% - 40px);
  background: white;
  border-radius: 20px;
  padding: 1.6rem 1.8rem;
  box-shadow: 0 6px 32px rgba(201,132,142,0.12);
  border: 1px solid rgba(255,192,203,0.3);
  position: relative;
  transition: transform 0.3s, box-shadow 0.3s;
}
.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(201,132,142,0.22);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 1.6rem;
  transform: translateX(-50%);
  width: 16px; height: 16px;
  background: white;
  border: 3px solid var(--blush);
  border-radius: 50%;
  z-index: 2;
}
.timeline-dot::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: var(--blush);
  border-radius: 50%;
}

.tl-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--rose-gold);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}
.tl-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.tl-desc-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Scrollable text area */
.tl-desc {
  font-size: 0.9rem;
  color: var(--soft-ink);
  line-height: 1.7;
  /* Collapsed: clip, no scroll, no scrollbar */
  max-height: 6.8em;
  overflow: hidden;
  scrollbar-width: none;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 4px;
  padding-right: 4px;
}
.tl-desc::-webkit-scrollbar { width: 0; }

/* Expanded: enable scroll + show scrollbar */
.tl-desc.expanded {
  max-height: 14em;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--petal) transparent;
  cursor: grab;
}
.tl-desc.expanded:active { cursor: grabbing; }
.tl-desc.expanded::-webkit-scrollbar { width: 4px; }
.tl-desc.expanded::-webkit-scrollbar-track { background: transparent; }
.tl-desc.expanded::-webkit-scrollbar-thumb {
  background: var(--petal);
  border-radius: 4px;
}
.tl-desc.expanded::-webkit-scrollbar-thumb:hover { background: var(--blush); }

/* Expand button — sits BELOW the scroll area, never overlaps */
.tl-expand-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.6rem;
  align-self: flex-start;
  padding: 0.28rem 0.85rem;
  background: rgba(255,192,203,0.15);
  border: 1px solid rgba(255,192,203,0.4);
  border-radius: 50px;
  font-family: 'Lora', serif;
  font-size: 0.75rem;
  color: var(--rose-gold);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
  user-select: none;
  flex-shrink: 0;
}
.tl-expand-btn:hover {
  background: rgba(255,192,203,0.28);
  border-color: var(--blush);
  transform: translateY(-1px);
}
.tl-expand-icon {
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-size: 0.85rem;
  line-height: 1;
}
.tl-expand-btn.open .tl-expand-icon {
  transform: rotate(180deg);
}

html.dark .tl-expand-btn {
  background: rgba(242,167,187,0.08);
  border-color: rgba(242,167,187,0.2);
}
html.dark .tl-expand-btn:hover {
  background: rgba(242,167,187,0.15);
  border-color: var(--blush);
}
html.dark .tl-desc.expanded::-webkit-scrollbar-thumb {
  background: var(--blush);
}
.tl-emoji {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.6rem;
}

.tl-photo {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FFE4EC, #FFF0F5);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  border: 1.5px dashed var(--petal);
  overflow: hidden;
}
.tl-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

@media (max-width: 620px) {
  .timeline-item { flex-direction: column !important; padding-left: 50px; }
  .timeline-card { width: 100%; }
  .timeline-dot  { left: 20px; }
}

/* ─── LETTER & CLOCK SECTION ─── */
#letter {
  position: relative;
  background: transparent;
  padding: 5rem 1rem 6rem;
  z-index: 4;
}

.clock-wrap {
  text-align: center;
  margin-bottom: 4rem;
}
.clock-label {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--rose-gold);
  margin-bottom: 1.4rem;
}
.clock-display {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.clock-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.clock-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.8rem, 8vw, 5rem);
  font-weight: 300;
  color: var(--mauve);
  line-height: 1;
  min-width: 2ch;
  text-align: center;
}
.clock-lbl {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--rose-gold);
  margin-top: 0.3rem;
}
.clock-sep {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  color: var(--petal);
  align-self: flex-start;
  margin-top: 0.1rem;
  line-height: 1.2;
}

.letter-card {
  max-width: 620px;
  margin: 0 auto;
  background: #FFFDF9;
  border-radius: 24px;
  padding: 3rem 3.5rem;
  box-shadow: 0 8px 48px rgba(201,132,142,0.14), inset 0 0 60px rgba(255,192,203,0.04);
  border: 1px solid rgba(255,192,203,0.25);
  position: relative;
}
.letter-card::before {
  content: '❝';
  position: absolute;
  top: 1.2rem; left: 1.8rem;
  font-size: 3rem;
  color: rgba(255,192,203,0.45);
  font-family: Georgia, serif;
  line-height: 1;
}
.letter-text {
  font-family: 'Be Vietnam Pro', 'Lora', serif;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-weight: 300;
  color: var(--soft-ink);
  line-height: 2;
  position: relative;
  z-index: 1;
}
.letter-text p { margin-bottom: 1.1rem; }
.letter-sig {
  font-family: 'Be Vietnam Pro', 'Lora', serif;
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 400;
  color: var(--mauve);
  text-align: right;
  margin-top: 1.5rem;
}

/* ─── MUSIC PLAYER ─── */
.music-player {
  max-width: 680px;
  margin: 1.8rem auto 0;
  position: relative;
}

/* Playlist panel */
.playlist-panel {
  background: var(--bg-music-bar);
  border: 1px solid var(--border-card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(201,132,142,0.1);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4,0,0.2,1), opacity 0.3s ease;
  opacity: 0;
}
.playlist-panel.open {
  max-height: 260px;
  opacity: 1;
  overflow-y: auto;
}
.playlist-panel::-webkit-scrollbar { width: 4px; }
.playlist-panel::-webkit-scrollbar-thumb { background: var(--petal); border-radius: 2px; }

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.2rem 0.5rem;
  font-family: 'Lora', serif;
  font-size: 0.8rem;
  color: var(--rose-gold);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  background: var(--bg-music-bar);
  z-index: 1;
}
.playlist-close {
  cursor: pointer;
  font-size: 0.9rem;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.playlist-close:hover { opacity: 1; }

.playlist-list {
  list-style: none;
  padding: 0.4rem 0;
}
.playlist-list li {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 1.2rem;
  font-family: 'Lora', serif;
  font-size: 0.82rem;
  color: var(--soft-ink);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-radius: 8px;
  margin: 0 0.4rem;
}
.playlist-list li:hover { background: rgba(255,192,203,0.12); color: var(--ink); }
.playlist-list li.active {
  background: rgba(255,192,203,0.2);
  color: var(--mauve);
  font-style: italic;
}
.playlist-list li .track-num {
  font-size: 0.72rem;
  color: var(--rose-gold);
  min-width: 1.4rem;
  text-align: right;
}
.playlist-list li .track-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playlist-list li .track-playing { font-size: 0.9rem; }

/* Controls bar */
.music-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg-music-bar);
  border-radius: 50px;
  padding: 0.7rem 1.2rem;
  box-shadow: 0 4px 20px rgba(201,132,142,0.12);
  border: 1px solid rgba(255,192,203,0.2);
  transition: border-radius 0.3s;
}
.playlist-panel.open + .music-bar {
  border-radius: 0 0 50px 50px;
  border-top: none;
}

.music-icon {
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.2s;
  user-select: none;
  flex-shrink: 0;
}
.music-icon:hover { transform: scale(1.2); }
#musicBtn { font-size: 1.4rem; }

.music-info { flex: 1; min-width: 0; }
.music-title {
  font-size: 0.82rem;
  color: var(--ink);
  font-family: 'Lora', serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

/* Seek bar row */
.music-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.music-time {
  font-size: 0.65rem;
  color: var(--rose-gold);
  font-family: monospace;
  min-width: 2.6rem;
  flex-shrink: 0;
}
.music-seek {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--blush) var(--prog, 0%), rgba(255,192,203,0.3) var(--prog, 0%));
  outline: none;
  cursor: pointer;
}
.music-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--blush);
  box-shadow: 0 1px 4px rgba(201,132,142,0.4);
  transition: transform 0.15s;
}
.music-seek::-webkit-slider-thumb:hover { transform: scale(1.3); }
.music-seek::-moz-range-thumb {
  width: 12px; height: 12px;
  border: none;
  border-radius: 50%;
  background: var(--blush);
}

/* Wave */
.music-wave {
  display: flex; gap: 3px; align-items: flex-end; height: 20px; flex-shrink: 0;
}
.music-wave span {
  display: block; width: 3px;
  background: var(--blush);
  border-radius: 2px;
  animation: wave 1s ease-in-out infinite;
}
.music-wave span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.music-wave span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.music-wave span:nth-child(3) { height: 12px; animation-delay: 0.2s; }
.music-wave span:nth-child(4) { height: 18px; animation-delay: 0.15s; }
.music-wave span:nth-child(5) { height: 10px; animation-delay: 0.05s; }
@keyframes wave {
  0%,100% { transform: scaleY(1); }
  50%      { transform: scaleY(0.4); }
}
.music-wave.paused span { animation-play-state: paused; }



/* ─── FOOTER ─── */
footer {
  text-align: center;
  padding: 2.5rem 1rem 3rem;
  font-family: 'Caveat', cursive;
  font-size: 1.15rem;
  color: var(--rose-gold);
  background: var(--bg-page);
  z-index: 1;
  position: relative;
}
footer .heart-footer { animation: heartbeat 1.4s ease-in-out infinite; display: inline-block; }

/* ─── DARK MODE ELEMENT OVERRIDES ─── */
html.dark body {
  background: var(--bg-page);
  color: var(--ink);
  transition: background 0.4s ease, color 0.4s ease;
}

html.dark #welcome {
  background: linear-gradient(160deg, #1A0D10 0%, #120A0D 40%, #0D0D0D 100%);
}
html.dark .welcome-deco::before {
  background: radial-gradient(circle, rgba(242,167,187,0.12) 0%, transparent 70%);
}
html.dark .welcome-deco::after {
  background: radial-gradient(circle, rgba(242,167,187,0.08) 0%, transparent 70%);
}

html.dark #timeline {
  background: linear-gradient(180deg, #0D0D0D 0%, #130A0D 100%);
}

html.dark #letter {
  background: linear-gradient(160deg, #140A0D, #0D0D0D 60%, #1A0D10);
}

html.dark .timeline-card {
  background: var(--bg-card);
  border-color: var(--border-card);
  box-shadow: 0 6px 32px var(--shadow-card);
}
html.dark .timeline-card:hover {
  box-shadow: 0 12px 40px rgba(242,167,187,0.15);
}
html.dark .timeline-dot {
  background: #1A1015;
}

html.dark .tl-photo {
  background: linear-gradient(135deg, #2A1520, #1A0D12);
  border-color: rgba(242,167,187,0.2);
}

html.dark .letter-card {
  background: var(--bg-letter-card);
  border-color: rgba(242,167,187,0.12);
  box-shadow: 0 8px 48px rgba(242,167,187,0.07);
}

html.dark .music-bar {
  background: var(--bg-music-bar);
  border-color: rgba(242,167,187,0.15);
}

html.dark footer {
  background: var(--bg-page);
}

html.dark .btn-start {
  box-shadow: 0 4px 24px rgba(242,167,187,0.25), 0 0 0 0 rgba(255,192,203,0.3);
}

/* smooth transition for all bg elements */
body, #welcome, #timeline, #letter, footer,
.timeline-card, .letter-card, .music-bar, .yt-input, .tl-photo {
  transition: background 0.4s ease, color 0.4s ease,
              border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ─── DARK MODE BG OVERRIDES ─── */
html.dark .bg-frosted {
  background: rgba(8,4,6,0.28);
}
html.dark #welcome  { background: transparent; }
html.dark #timeline { background: transparent; }
html.dark #letter   { background: transparent; }

/* section content needs semi-transparent backing for readability */
#timeline, #letter {
  position: relative;
}
#timeline::before, #letter::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,250,247,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 0;
  transition: background 0.4s ease;
}
html.dark #timeline::before,
html.dark #letter::before {
  background: rgba(10,6,8,0.62);
}
/* push all children above the backdrop */
#timeline > *, #letter > * { position: relative; z-index: 1; }

footer {
  position: relative;
  z-index: 4;
  background: rgba(255,250,247,0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.4s ease;
}
html.dark footer {
  background: rgba(10,6,8,0.7);
}

/* ─── DARK MODE: MUSIC PLAYER ─── */
html.dark .music-bar,
html.dark .playlist-panel {
  background: var(--bg-music-bar);
  border-color: var(--border-card);
}
html.dark .playlist-header {
  background: var(--bg-music-bar);
  border-color: var(--border-card);
}
html.dark .playlist-list li:hover {
  background: rgba(242,167,187,0.08);
}
html.dark .playlist-list li.active {
  background: rgba(242,167,187,0.12);
}
html.dark .music-seek {
  background: linear-gradient(90deg, var(--blush) var(--prog, 0%), rgba(242,167,187,0.15) var(--prog, 0%));
}

/* ─── TIMELINE ENDING NOTE ─── */
.tl-ending {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1rem;
  padding-bottom: 2rem;
}

.tl-ending-line {
  width: 2px;
  height: 48px;
  background: linear-gradient(180deg, var(--blush), transparent);
  margin-bottom: 1.2rem;
}

.tl-ending-card {
  text-align: center;
  padding: 2rem 2.5rem;
  background: white;
  border-radius: 24px;
  border: 1.5px dashed var(--petal);
  box-shadow: 0 6px 32px rgba(201,132,142,0.1);
  max-width: 360px;
  position: relative;
  animation: fadeUp 0.8s ease both;
  transition: transform 0.3s, box-shadow 0.3s;
}
.tl-ending-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(201,132,142,0.18);
}

.tl-ending-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

.tl-ending-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  color: var(--soft-ink);
  line-height: 1.75;
  letter-spacing: 0.01em;
}
.tl-ending-text em {
  font-style: italic;
  color: var(--mauve);
  display: block;
  margin-top: 0.25rem;
}

.tl-ending-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 1.2rem;
}
.tl-ending-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--petal);
  animation: dot-pulse 1.5s ease-in-out infinite;
}
.tl-ending-dots span:nth-child(1) { animation-delay: 0s; }
.tl-ending-dots span:nth-child(2) { animation-delay: 0.25s; }
.tl-ending-dots span:nth-child(3) { animation-delay: 0.5s; }
@keyframes dot-pulse {
  0%, 100% { transform: scale(1);   opacity: 0.5; }
  50%       { transform: scale(1.5); opacity: 1; }
}

html.dark .tl-ending-card {
  background: var(--bg-card);
  border-color: rgba(242,167,187,0.2);
}
html.dark .tl-ending-text { color: var(--soft-ink); }
html.dark .tl-ending-text em { color: var(--mauve); }
/* ─── ENVELOPE SCENE ─── */
.envelope-scene {
  max-width: 620px;
  margin: 0 auto 2rem;
  position: relative;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Envelope wrapper ── */
.envelope-wrap {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}
.envelope-wrap:hover { transform: translateY(-6px) scale(1.02); }

/* ── Envelope body ── */
.env-body {
  position: relative;
  width: 320px;
  height: 220px;
  background: linear-gradient(160deg, #fff5f8, #fff0f5);
  border-radius: 6px 6px 12px 12px;
  box-shadow: 0 10px 48px rgba(201,132,142,0.22), 0 2px 8px rgba(201,132,142,0.12);
  border: 1.5px solid rgba(255,192,203,0.5);
  overflow: visible;
}
html.dark .env-body {
  background: linear-gradient(160deg, #200f15, #180e12);
  border-color: rgba(242,167,187,0.2);
  box-shadow: 0 10px 48px rgba(242,167,187,0.1);
}

/* Triangle flap (top) */
.env-flap {
  position: absolute;
  top: 0; left: 0;
  width: 0; height: 0;
  border-left: 160px solid transparent;
  border-right: 160px solid transparent;
  border-top: 110px solid #f9d0dc;
  transform-origin: top center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}
html.dark .env-flap {
  border-top-color: #3a1520;
}
.env-body.opened .env-flap {
  transform: rotateX(180deg);
}

/* Side triangles */
.env-left {
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 0;
  border-bottom: 110px solid #f0c0ce;
  border-right: 160px solid transparent;
  border-radius: 0 0 0 6px;
}
.env-right {
  position: absolute;
  bottom: 0; right: 0;
  width: 0; height: 0;
  border-bottom: 110px solid #edb8c7;
  border-left: 160px solid transparent;
  border-radius: 0 0 6px 0;
}
html.dark .env-left  { border-bottom-color: #2a1018; }
html.dark .env-right { border-bottom-color: #250e16; }

/* Bottom strip */
.env-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  background: #f5c8d5;
  border-radius: 0 0 10px 10px;
}
html.dark .env-bottom { background: #2e1219; }

/* Heart / emoji seal */
.env-heart {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2.8rem;
  z-index: 5;
  animation: heartbeat 1.4s ease-in-out infinite;
  filter: drop-shadow(0 2px 8px rgba(201,132,142,0.4));
}

.env-hint {
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Be Vietnam Pro', serif;
  font-size: 0.8rem;
  color: var(--rose-gold);
  white-space: nowrap;
  font-style: italic;
  opacity: 0.8;
  letter-spacing: 0.04em;
}

/* ── Letter reveal ── */
.letter-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(30px) scale(0.96);
  transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}
.letter-reveal.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* When scene is open, expand min-height to fit letter */
.envelope-scene.open {
  min-height: auto;
}
.envelope-scene.open .envelope-wrap {
  display: none;
}
.envelope-scene.open .letter-reveal {
  position: relative;
  inset: auto;
}

/* ── Letter card (used inside reveal) ── */
.letter-card {
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
  background: #FFFDF9;
  border-radius: 24px;
  padding: 3rem 3.5rem 2.5rem;
  box-shadow: 0 8px 48px rgba(201,132,142,0.14), inset 0 0 60px rgba(255,192,203,0.04);
  border: 1px solid rgba(255,192,203,0.25);
  position: relative;
  animation: none;
}
.letter-card::before {
  content: '❝';
  position: absolute;
  top: 1.2rem; left: 1.8rem;
  font-size: 3rem;
  color: rgba(255,192,203,0.45);
  font-family: Georgia, serif;
  line-height: 1;
}

/* ── Close button ── */
.letter-close-btn {
  display: block;
  margin: 1.8rem auto 0;
  padding: 0.6rem 2rem;
  background: transparent;
  border: 1.5px solid var(--petal);
  border-radius: 50px;
  font-family: 'Be Vietnam Pro', serif;
  font-size: 0.82rem;
  color: var(--rose-gold);
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: background 0.2s, transform 0.2s;
}
.letter-close-btn:hover {
  background: rgba(255,192,203,0.15);
  transform: translateY(-2px);
}

html.dark .letter-card {
  background: var(--bg-letter-card);
  border-color: rgba(242,167,187,0.12);
  box-shadow: 0 8px 48px rgba(242,167,187,0.07);
}
html.dark .letter-close-btn {
  border-color: rgba(242,167,187,0.3);
}

@media (max-width: 480px) {
  .env-body { width: 260px; height: 180px; }
  .env-flap { border-left-width: 130px; border-right-width: 130px; border-top-width: 90px; }
  .env-left { border-bottom-width: 90px; border-right-width: 130px; }
  .env-right { border-bottom-width: 90px; border-left-width: 130px; }
  .letter-card { padding: 2rem 1.5rem; }
}
/* ═══════════════════════════════════════════
   NEW ADDITIONS — music icons, fullscreen, comments
   ═══════════════════════════════════════════ */

/* ─── MUSIC BUTTONS — unified icon system ─── */
.music-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--blush);
  padding: 0;
  transition: transform 0.2s, color 0.25s, background 0.2s;
  border-radius: 50%;
  outline: none;
}
.music-btn:hover { transform: scale(1.18); color: var(--rose-gold); }
.music-btn:active { transform: scale(0.9); }

/* Prev & Next — smaller */
.music-btn-prev,
.music-btn-next {
  width: 30px; height: 30px;
  color: var(--blush);
  opacity: 0.85;
}
.music-btn-prev:hover,
.music-btn-next:hover { opacity: 1; }

/* Play/Pause — prominent circle */
.music-btn-play {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, rgba(255,192,203,0.22), rgba(242,167,187,0.32));
  border: 1.5px solid rgba(255,192,203,0.5);
  color: var(--blush);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 10px rgba(201,132,142,0.22);
}
.music-btn-play:hover {
  background: linear-gradient(135deg, rgba(255,192,203,0.38), rgba(242,167,187,0.48));
  box-shadow: 0 4px 16px rgba(201,132,142,0.35);
  transform: scale(1.1);
  color: var(--rose-gold);
}
.music-btn-play:active { transform: scale(0.93); }

/* Playlist toggle */
.music-btn-playlist {
  width: 30px; height: 30px;
  color: var(--blush);
  opacity: 0.85;
}
.music-btn-playlist:hover { opacity: 1; }

/* SVG icons inside buttons are currentColor — no hardcoded colors */
.music-btn svg { display: block; pointer-events: none; }

/* Dark/dawn/dusk overrides */
html.dark .music-btn-play {
  background: linear-gradient(135deg, rgba(242,167,187,0.12), rgba(200,100,130,0.2));
  border-color: rgba(242,167,187,0.25);
}
html.dark .music-btn-play:hover {
  background: linear-gradient(135deg, rgba(242,167,187,0.22), rgba(200,100,130,0.32));
  transform: scale(1.1);
}

/* icon-play / icon-pause toggled via JS display:none */
.icon-play, .icon-pause { pointer-events: none; display: block; }



/* ─── FULLSCREEN MODAL ─── */
.fullscreen-overlay {
  position: fixed; inset: 0;
  background: rgba(20,8,12,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.fullscreen-overlay.active {
  opacity: 1; pointer-events: auto;
}
.fullscreen-card {
  background: var(--bg-card);
  border-radius: 24px;
  width: 100%; max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(201,132,142,0.3);
  border: 1px solid var(--border-card);
  position: relative;
  transform: scale(0.94) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  scrollbar-width: thin; scrollbar-color: var(--petal) transparent;
}
.fullscreen-overlay.active .fullscreen-card {
  transform: scale(1) translateY(0);
}
.fullscreen-card::-webkit-scrollbar { width: 4px; }
.fullscreen-card::-webkit-scrollbar-thumb { background: var(--petal); border-radius: 2px; }

.fullscreen-close {
  position: sticky; top: 1rem;
  float: right; margin: 1rem 1rem 0 0;
  width: 34px; height: 34px;
  background: rgba(255,192,203,0.15);
  border: 1px solid rgba(255,192,203,0.35);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--rose-gold);
  transition: background 0.2s, transform 0.2s;
  z-index: 2;
}
.fullscreen-close:hover { background: rgba(255,192,203,0.3); transform: rotate(90deg); }

.fullscreen-inner {
  padding: 1.5rem 2.5rem 2.5rem;
  clear: both;
}

/* Fullscreen layout: photo left, text right on desktop */
.fs-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 640px) {
  .fs-layout { grid-template-columns: 1fr; }
  .fullscreen-inner { padding: 1rem 1.2rem 2rem; }
}
.fs-photo {
  width: 100%; aspect-ratio: 4/3;
  border-radius: 16px;
  background: linear-gradient(135deg, #FFE4EC, #FFF0F5);
  border: 1.5px dashed var(--petal);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.fs-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; }
html.dark .fs-photo { background: linear-gradient(135deg, #2A1520, #1A0D12); }

.fs-content { display: flex; flex-direction: column; gap: 0.6rem; }
.fs-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem; font-style: italic;
  color: var(--rose-gold); letter-spacing: 0.06em;
}
.fs-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 400; color: var(--ink); line-height: 1.3;
}
.fs-desc {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.95rem; font-weight: 300;
  color: var(--soft-ink); line-height: 1.85;
  max-height: 45vh; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--petal) transparent;
  padding-right: 4px;
}
.fs-desc::-webkit-scrollbar { width: 3px; }
.fs-desc::-webkit-scrollbar-thumb { background: var(--petal); border-radius: 2px; }

/* ─── EXPAND ICON (inline, beside bình luận button) ─── */
.tl-expand-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: rgba(255,192,203,0.12);
  border: 1px solid rgba(255,192,203,0.35);
  border-radius: 50%;
  color: var(--rose-gold);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.tl-expand-icon-btn:hover {
  background: rgba(255,192,203,0.28);
  transform: scale(1.1);
}
html.dark .tl-expand-icon-btn {
  background: rgba(242,167,187,0.08);
  border-color: rgba(242,167,187,0.2);
}
html.dark .tl-expand-icon-btn:hover {
  background: rgba(242,167,187,0.18);
}

/* ─── COMMENTS (inside card) ─── */
.tl-comments {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,192,203,0.25);
}
html.dark .tl-comments {
  border-top-color: rgba(242,167,187,0.12);
}

.comment-reactions {
  display: flex; gap: 0.6rem; align-items: center;
  margin-bottom: 0.5rem;
}
.react-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  background: rgba(255,192,203,0.12);
  border: 1px solid rgba(255,192,203,0.3);
  border-radius: 50px;
  font-size: 0.78rem; color: var(--rose-gold);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  font-family: 'Lora', serif;
}
.react-btn.liked {
  background: rgba(242,167,187,0.25);
  border-color: var(--blush);
}
.react-btn.liked .react-heart-svg path {
  fill: #F2A7BB;
  stroke: #F2A7BB;
}
.react-btn:hover { transform: scale(1.06); }
.react-btn:active { transform: scale(0.94); animation: heart-pop 0.3s ease; }
@keyframes heart-pop {
  0%   { transform: scale(0.94); }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1.06); }
}
.react-count { font-weight: 600; min-width: 1ch; }

.comment-toggle-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  background: rgba(255,192,203,0.1);
  border: 1px solid rgba(255,192,203,0.25);
  border-radius: 50px;
  font-size: 0.78rem; color: var(--soft-ink);
  cursor: pointer;
  transition: background 0.2s;
  font-family: 'Lora', serif;
}
.comment-toggle-btn:hover { background: rgba(255,192,203,0.2); color: var(--ink); }

.comment-input-area {
  display: flex; gap: 0.5rem; margin-bottom: 0.6rem;
  animation: fadeUp 0.25s ease;
}
.comment-input {
  flex: 1; padding: 0.45rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid rgba(255,192,203,0.35);
  border-radius: 50px;
  font-family: 'Lora', serif;
  font-size: 0.82rem; color: var(--ink);
  outline: none; transition: border-color 0.2s;
}
.comment-input:focus { border-color: var(--blush); }
.comment-input::placeholder { color: var(--rose-gold); opacity: 0.6; }
.comment-submit-btn {
  padding: 0.45rem 1rem;
  background: linear-gradient(135deg, var(--petal), var(--blush));
  color: white; border: none; border-radius: 50px;
  font-family: 'Lora', serif;
  font-size: 0.8rem; cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.comment-submit-btn:hover { opacity: 0.88; transform: translateY(-1px); }

.comment-list { display: flex; flex-direction: column; gap: 0.5rem; }

.comment-item {
  background: var(--bg-card);
  border: 1px solid rgba(255,192,203,0.2);
  border-radius: 14px;
  padding: 0.6rem 0.9rem;
  font-family: 'Lora', serif;
  font-size: 0.82rem; color: var(--soft-ink);
  position: relative;
  animation: fadeUp 0.3s ease;
}
.comment-item.editing {
  border-color: var(--blush);
  background: rgba(255,192,203,0.06);
}
.comment-body { line-height: 1.55; word-break: break-word; }
.comment-edit-input {
  width: 100%; border: none; outline: none;
  background: transparent;
  font-family: 'Lora', serif;
  font-size: 0.82rem; color: var(--ink);
  resize: none; line-height: 1.55;
}
.comment-meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 0.3rem;
}
.comment-time {
  font-size: 0.68rem;
  color: var(--rose-gold);
  opacity: 0.7;
  transition: color 0.3s ease;
}
.comment-actions { display: flex; gap: 0.4rem; }
.comment-action-btn {
  font-size: 0.68rem; color: var(--rose-gold);
  background: none; border: none; cursor: pointer; padding: 0;
  opacity: 0.6; transition: opacity 0.15s, color 0.3s ease;
  font-family: 'Lora', serif;
}
.comment-action-btn:hover { opacity: 1; }
.comment-action-btn.delete { color: #e57373; }
.comment-action-btn.save   { color: #7aa86e; }

/* ── Comment elements: transition theo dark/light mode ── */
.comment-item {
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
.comment-input {
  transition: border-color 0.2s, background 0.3s ease, color 0.3s ease;
}
.react-btn {
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.15s;
}
.comment-toggle-btn {
  transition: background 0.2s, border-color 0.3s ease, color 0.3s ease;
}
.comment-submit-btn {
  transition: opacity 0.2s, transform 0.15s;
}
.tl-comments {
  transition: border-color 0.3s ease;
}

html.dark .comment-input  { background: var(--bg-card); border-color: rgba(242,167,187,0.2); }
html.dark .comment-item   { background: rgba(242,167,187,0.04); border-color: rgba(242,167,187,0.12); }
html.dark .react-btn      { background: rgba(242,167,187,0.08); border-color: rgba(242,167,187,0.2); }
html.dark .comment-toggle-btn { border-color: rgba(242,167,187,0.15); }

/* ═══════════════════════════════════════════
   DAILY LOVE LETTER
   ═══════════════════════════════════════════ */

/* ─── Trigger button ─── */
.daily-trigger {
  position: fixed;
  bottom: 1.6rem;
  left: 1.4rem;
  z-index: 900;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,192,203,0.5);
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rose-gold);
  box-shadow: 0 4px 20px rgba(201,132,142,0.22), 0 1px 4px rgba(201,132,142,0.12);
  transition: transform 0.22s cubic-bezier(.34,1.56,.64,1), background 0.25s, box-shadow 0.25s;
}
.daily-trigger:hover {
  transform: scale(1.12);
  background: rgba(255,192,203,0.3);
  box-shadow: 0 6px 24px rgba(201,132,142,0.32);
}
.daily-trigger:active { transform: scale(0.94); }

html.dark .daily-trigger {
  background: rgba(20,10,15,0.55);
  border-color: rgba(242,167,187,0.3);
}
html.dusk .daily-trigger {
  background: rgba(37,19,24,0.6);
  border-color: rgba(232,149,106,0.3);
}
html.dawn .daily-trigger {
  background: rgba(255,253,248,0.35);
  border-color: rgba(232,148,106,0.35);
}

/* Unread dot */
.daily-icon-unread { position: relative; display: flex; align-items: center; justify-content: center; }
.daily-unread-dot {
  position: absolute;
  top: -3px;
  right: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F9A7BB, #E07090);
  border: 1.5px solid rgba(255,255,255,0.9);
  animation: daily-dot-pulse 2s ease-in-out infinite;
}
@keyframes daily-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242,107,139,0.45); }
  50%       { box-shadow: 0 0 0 5px rgba(242,107,139,0); }
}
html.dark .daily-unread-dot { border-color: rgba(26,16,21,0.9); }

/* ─── Overlay backdrop ─── */
.daily-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0 0 5.2rem 1.4rem;
  pointer-events: none;
}
.daily-overlay.active { pointer-events: auto; }

/* ─── The board itself ─── */
.daily-board {
  position: relative;
  width: min(400px, calc(100vw - 2.8rem));
  background: var(--bg-letter-card);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  box-shadow:
    0 8px 40px rgba(201,132,142,0.18),
    0 2px 8px rgba(201,132,142,0.1),
    inset 0 0 0 1px rgba(255,255,255,0.6);
  padding: 1.6rem 1.6rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 80vh;
  overflow: hidden;

  /* Start hidden */
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.35s cubic-bezier(0.4,0,0.2,1),
              transform 0.35s cubic-bezier(0.34,1.3,0.64,1);
  pointer-events: none;
}
.daily-board.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

html.dark .daily-board {
  background: var(--bg-letter-card);
  border-color: rgba(242,167,187,0.14);
  box-shadow: 0 8px 40px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(242,167,187,0.06);
}
html.dusk .daily-board {
  box-shadow: 0 8px 40px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(232,149,106,0.1);
}

/* Close button */
.daily-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: rgba(255,192,203,0.1);
  color: var(--rose-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
}
.daily-close:hover { opacity: 1; background: rgba(255,192,203,0.22); transform: scale(1.1); }

/* ─── Header ─── */
.daily-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.1rem;
}
.daily-deco-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--petal), transparent);
  opacity: 0.6;
}
.daily-title {
  font-family: 'Cormorant Garamond', 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 400;
  font-style: italic;
  color: var(--rose-gold);
  letter-spacing: 0.04em;
  white-space: nowrap;
  margin: 0;
}

/* Date line */
.daily-date {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--mauve);
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.3rem;
  opacity: 0.8;
}

/* ─── Content area ─── */
.daily-content {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--petal) transparent;
  padding-right: 0.3rem;
  min-height: 80px;
  max-height: calc(80vh - 200px);
}
.daily-content::-webkit-scrollbar { width: 3px; }
.daily-content::-webkit-scrollbar-thumb { background: var(--petal); border-radius: 2px; }

/* Letter typography */
.daily-content p, .daily-letter-text {
  font-family: 'Lora', 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--ink);
  margin: 0 0 0.8em;
  white-space: pre-wrap;
}
.daily-empty {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.88rem;
  color: var(--mauve);
  text-align: center;
  padding: 1.2rem 0;
  opacity: 0.75;
}

/* ─── Footer ─── */
.daily-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-card);
}
.daily-history-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--mauve);
  background: none;
  border: 1px solid var(--border-card);
  border-radius: 50px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s, background 0.2s, transform 0.15s;
}
.daily-history-btn:hover {
  opacity: 1;
  background: rgba(255,192,203,0.12);
  transform: translateY(-1px);
}

/* ─── History board ─── */
.daily-history-board { max-height: 75vh; }

.history-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--petal) transparent;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-right: 0.3rem;
  max-height: calc(75vh - 180px);
}
.history-list::-webkit-scrollbar { width: 3px; }
.history-list::-webkit-scrollbar-thumb { background: var(--petal); border-radius: 2px; }

.history-item {
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: rgba(255,192,203,0.04);
}
.history-item-date {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--mauve);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.45rem;
  opacity: 0.7;
}
.history-item-text {
  font-family: 'Lora', serif;
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--ink);
  white-space: pre-wrap;
  margin: 0;
}
.history-empty {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.88rem;
  color: var(--mauve);
  text-align: center;
  padding: 2rem 0;
  opacity: 0.7;
}

/* Decoration hearts scattered */
.daily-board::before {
  content: '✦';
  position: absolute;
  top: 0.65rem;
  left: 1rem;
  font-size: 0.55rem;
  color: var(--petal);
  opacity: 0.5;
  pointer-events: none;
}

/* ═══════════════════════════════════════════
   UPDATE NOTIFICATION 💕
   ═══════════════════════════════════════════ */

/* ─── Trigger button (top-left) ─── */
.update-trigger {
  position: fixed;
  top: 1.1rem;
  left: 1.2rem;
  z-index: 999;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,192,203,0.5);
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(201,132,142,0.18);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, transform 0.2s, border-color 0.25s;
  color: var(--rose-gold);
}
.update-trigger:hover {
  background: rgba(255,192,203,0.28);
  transform: scale(1.08);
}
html.dark .update-trigger {
  background: rgba(20,10,15,0.5);
  border-color: rgba(242,167,187,0.3);
}

/* The "i" label */
.update-icon-label {
  font-family: 'Cormorant Garamond', 'Lora', serif;
  font-style: italic;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  color: var(--rose-gold);
  user-select: none;
}

/* New-update badge dot */
.update-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #F2A7BB;
  border: 1.5px solid var(--bg-page, #FFFAF7);
  display: none;
  animation: updatePulse 2s ease-in-out infinite;
}
.update-badge.visible { display: block; }

@keyframes updatePulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.7; }
}

/* ─── Fullscreen overlay ─── */
.update-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(58,35,40,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.update-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Board panel ─── */
.update-board {
  position: relative;
  width: min(520px, calc(100vw - 2.4rem));
  max-height: 85vh;
  background: var(--bg-letter-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  box-shadow:
    0 12px 60px rgba(201,132,142,0.22),
    0 2px 12px rgba(201,132,142,0.12),
    inset 0 0 0 1px rgba(255,255,255,0.55);
  padding: 1.8rem 1.8rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow: hidden;

  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.38s cubic-bezier(0.4,0,0.2,1),
              transform 0.38s cubic-bezier(0.34,1.3,0.64,1);
}
.update-overlay.open .update-board {
  opacity: 1;
  transform: translateY(0) scale(1);
}
html.dark .update-board {
  background: var(--bg-letter-card);
  border-color: rgba(242,167,187,0.14);
  box-shadow: 0 12px 60px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(242,167,187,0.06);
}
html.dusk .update-board {
  box-shadow: 0 12px 60px rgba(0,0,0,0.42), inset 0 0 0 1px rgba(232,149,106,0.1);
}

/* ─── Close button ─── */
.update-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: rgba(255,192,203,0.1);
  color: var(--rose-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s, transform 0.2s;
}
.update-close:hover { opacity: 1; background: rgba(255,192,203,0.22); transform: scale(1.1); }

/* ─── Header ─── */
.update-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.1rem;
}
.update-deco-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--petal), transparent);
  opacity: 0.6;
}
.update-title {
  font-family: 'Cormorant Garamond', 'Lora', serif;
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: var(--rose-gold);
  letter-spacing: 0.04em;
  white-space: nowrap;
  margin: 0;
}
.update-subtitle {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.72rem;
  font-weight: 300;
  color: var(--mauve);
  text-align: center;
  letter-spacing: 0.05em;
  margin: 0 0 0.4rem;
  opacity: 0.75;
}

/* ─── Scrollable changelog list ─── */
.update-list {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--petal) transparent;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-right: 0.3rem;
  max-height: calc(85vh - 180px);
}
.update-list::-webkit-scrollbar { width: 3px; }
.update-list::-webkit-scrollbar-thumb { background: var(--petal); border-radius: 2px; }

/* ─── Each changelog entry ─── */
.update-entry {
  border: 1px solid var(--border-card);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  background: rgba(255,192,203,0.03);
  transition: background 0.2s;
}
.update-entry:first-child {
  border-color: rgba(242,167,187,0.45);
  background: rgba(255,192,203,0.07);
}
.update-entry-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.update-entry-date {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--mauve);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.75;
}
.update-entry-tag {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 50px;
  border: 1px solid rgba(242,167,187,0.4);
  color: var(--rose-gold);
  background: rgba(255,192,203,0.12);
}
.update-entry-tag.new-tag {
  background: rgba(242,167,187,0.2);
  border-color: rgba(242,167,187,0.6);
  color: var(--rose-gold);
}
.update-entry-title {
  font-family: 'Cormorant Garamond', 'Lora', serif;
  font-size: 0.97rem;
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 0.35rem;
  line-height: 1.4;
}
.update-entry-desc {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--soft-ink);
  margin: 0;
  opacity: 0.9;
}

/* Decoration dot on first entry (newest) */
.update-board::before {
  content: '✦';
  position: absolute;
  top: 0.65rem;
  left: 1rem;
  font-size: 0.55rem;
  color: var(--petal);
  opacity: 0.5;
  pointer-events: none;
}
/* ═══════════════════════════════════════════
   WRITE LOVE LETTER MODAL 💌
   ═══════════════════════════════════════════ */

/* ─── Daily footer with two buttons ─── */
.daily-footer {
  gap: 0.5rem;
}

/* Write button in daily footer */
.daily-write-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--bg-letter-card);
  background: var(--rose-gold);
  border: 1px solid transparent;
  border-radius: 50px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.2s, background 0.2s, transform 0.15s;
}
.daily-write-btn:hover {
  opacity: 1;
  background: var(--blush);
  transform: translateY(-1px);
}

/* ─── Write overlay ─── */
.write-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(30, 8, 16, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.4,0,0.2,1);
}
.write-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Write board ─── */
.write-board {
  position: relative;
  width: min(480px, calc(100vw - 2.4rem));
  background: var(--bg-letter-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  box-shadow:
    0 12px 60px rgba(201,132,142,0.22),
    0 2px 12px rgba(201,132,142,0.12),
    inset 0 0 0 1px rgba(255,255,255,0.55);
  padding: 1.8rem 1.8rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 90vh;
  overflow: hidden;

  opacity: 0;
  transform: translateY(20px) scale(0.96);
  transition: opacity 0.35s cubic-bezier(0.4,0,0.2,1),
              transform 0.35s cubic-bezier(0.34,1.3,0.64,1);
}
.write-overlay.active .write-board {
  opacity: 1;
  transform: translateY(0) scale(1);
}
html.dark .write-board {
  background: var(--bg-letter-card);
  border-color: rgba(242,167,187,0.14);
  box-shadow: 0 12px 60px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(242,167,187,0.06);
}
html.dusk .write-board {
  box-shadow: 0 12px 60px rgba(0,0,0,0.42), inset 0 0 0 1px rgba(232,149,106,0.1);
}

/* ─── Author selector row ─── */
.write-author-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.write-author-label {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.78rem;
  font-weight: 300;
  color: var(--mauve);
  letter-spacing: 0.04em;
  opacity: 0.85;
  white-space: nowrap;
}
.write-author-pills {
  display: flex;
  gap: 0.5rem;
}
.write-author-pill {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--soft-ink);
  background: rgba(255,192,203,0.08);
  border: 1.5px solid var(--border-card);
  border-radius: 50px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.02em;
}
.write-author-pill:hover {
  background: rgba(255,192,203,0.18);
  border-color: rgba(242,167,187,0.5);
  color: var(--rose-gold);
}
.write-author-pill.active {
  background: rgba(242,167,187,0.18);
  border-color: var(--blush);
  color: var(--rose-gold);
}
.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-card);
  transition: background 0.2s;
}
.write-author-pill.active .pill-dot {
  background: var(--blush);
}

/* ─── Textarea wrapper ─── */
.write-textarea-wrap {
  position: relative;
  flex: 1;
}
.write-textarea {
  width: 100%;
  min-height: 180px;
  max-height: calc(90vh - 320px);
  resize: vertical;
  background: rgba(255,192,203,0.04);
  border: 1.5px solid var(--border-card);
  border-radius: 14px;
  padding: 1rem 1.1rem 2rem;
  font-family: 'Lora', 'Cormorant Garamond', serif;
  font-size: 0.93rem;
  line-height: 1.85;
  color: var(--ink);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}
.write-textarea::placeholder {
  color: var(--mauve);
  opacity: 0.5;
  font-style: italic;
}
.write-textarea:focus {
  border-color: rgba(242,167,187,0.6);
  background: rgba(255,192,203,0.06);
}
html.dark .write-textarea {
  background: rgba(255,192,203,0.03);
  color: var(--ink);
}
.write-char-count {
  position: absolute;
  bottom: 0.55rem;
  right: 0.8rem;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.65rem;
  color: var(--mauve);
  opacity: 0.5;
  pointer-events: none;
}

/* ─── Actions row ─── */
.write-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-top: 0.2rem;
}
.write-btn-cancel {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--mauve);
  background: none;
  border: 1px solid var(--border-card);
  border-radius: 50px;
  padding: 0.42rem 1rem;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s, background 0.2s;
}
.write-btn-cancel:hover {
  opacity: 1;
  background: rgba(255,192,203,0.1);
}
.write-btn-submit {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--bg-letter-card);
  background: var(--rose-gold);
  border: 1px solid transparent;
  border-radius: 50px;
  padding: 0.42rem 1.15rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, opacity 0.2s;
}
.write-btn-submit:hover {
  background: var(--blush);
  transform: translateY(-1px);
}
.write-btn-submit:active {
  transform: translateY(0);
}

/* ─── Success toast ─── */
.write-success {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(242,167,187,0.18);
  border: 1px solid rgba(242,167,187,0.45);
  border-radius: 50px;
  padding: 0.4rem 1.2rem;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.8rem;
  color: var(--rose-gold);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.write-success.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Author signature shown in daily letter ─── */
.daily-author-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--rose-gold);
  background: rgba(242,167,187,0.12);
  border: 1px solid rgba(242,167,187,0.3);
  border-radius: 50px;
  padding: 2px 0.7rem;
  margin-bottom: 0.6rem;
  letter-spacing: 0.04em;
}

/* ─── Mobile adjustments ─── */
@media (max-width: 480px) {
  .write-board {
    padding: 1.4rem 1.2rem 1.1rem;
    border-radius: 18px;
  }
  .write-textarea {
    min-height: 140px;
    font-size: 0.9rem;
  }
  .write-author-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }
  .daily-footer {
    flex-wrap: wrap;
  }
}

/* ── History item author badge ── */
.history-item-author {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.67rem;
  color: var(--rose-gold);
  background: rgba(242,167,187,0.12);
  border: 1px solid rgba(242,167,187,0.28);
  border-radius: 50px;
  padding: 1px 0.55rem;
  margin-left: 0.45rem;
  vertical-align: middle;
  font-family: 'Be Vietnam Pro', sans-serif;
  letter-spacing: 0.03em;
}

/* ── Write submit loading state ── */
.write-btn-submit[disabled],
.write-btn-submit[style*="pointer-events: none"] {
  opacity: 0.6 !important;
  cursor: wait;
}
/* ── Pill emoji ── */
.pill-emoji {
  font-size: 0.95rem;
  line-height: 1;
}

/* ═══════════════════════════════════════════
   WRITE REMINDER TOAST 💌
   ═══════════════════════════════════════════ */
.write-reminder-toast {
  position: fixed;
  bottom: 5.6rem;
  left: 1.4rem;
  z-index: 940;
  max-width: calc(100vw - 2.8rem);
  width: 300px;
  background: var(--bg-letter-card);
  border: 1px solid rgba(242,167,187,0.35);
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(201,132,142,0.22),
    0 2px 8px rgba(201,132,142,0.1),
    inset 0 0 0 1px rgba(255,255,255,0.5);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.34,1.3,0.64,1);
  pointer-events: none;
}
.write-reminder-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
html.dark .write-reminder-toast {
  border-color: rgba(242,167,187,0.18);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(242,167,187,0.06);
}

.wrt-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 0.9rem;
  cursor: pointer;
}
.wrt-icon {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,192,203,0.15);
  border: 1px solid rgba(242,167,187,0.3);
  display: flex; align-items: center; justify-content: center;
  color: var(--rose-gold);
}
.wrt-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.wrt-title {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.3;
}
.wrt-sub {
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.7rem;
  font-weight: 300;
  color: var(--mauve);
  opacity: 0.75;
}
.wrt-btn {
  flex-shrink: 0;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.72rem;
  font-weight: 400;
  color: white;
  background: linear-gradient(135deg, var(--petal), var(--blush));
  border: none;
  border-radius: 50px;
  padding: 0.32rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(201,132,142,0.3);
  transition: opacity 0.2s, transform 0.15s;
}
.wrt-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.wrt-dismiss {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: transparent;
  color: var(--mauve);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
}
.wrt-dismiss:hover { opacity: 1; background: rgba(255,192,203,0.15); }