/* ==========================================================================
   20-10 GIFT FOR KHÁNH • OPTION 1: SUNSET GLOW & PEACHY VIBE
   Palette: Warm Peach Coral, Sunset Rose, Soft Lilac Glow & Honey Gold
   ========================================================================== */

:root {
  /* Color Tokens - Sunset Glow */
  --bg-primary: #FFF5F0;
  --bg-secondary: #FFEBE3;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-inner: rgba(255, 255, 255, 0.72);
  
  --sunset-coral: #FF725E;
  --sunset-rose: #FF5376;
  --sunset-peach: #FFA07A;
  --sunset-gold: #FFB703;
  --sunset-amber: #FF9F1C;
  --sunset-lilac: #A370F7;

  --text-main: #2B1810;
  --text-body: #543932;
  --text-muted: #8F7068;
  
  --border-card: rgba(255, 114, 94, 0.28);
  --border-subtle: rgba(255, 114, 94, 0.16);

  --shadow-card: 0 18px 45px rgba(255, 83, 118, 0.16), 0 4px 15px rgba(0, 0, 0, 0.04);
  --shadow-floating: 0 12px 35px rgba(255, 114, 94, 0.25);
  --shadow-glow: 0 0 30px rgba(255, 114, 94, 0.35);

  /* Typography */
  --font-serif: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-letter: 'Be Vietnam Pro', var(--font-sans);
  --font-script: 'Alex Brush', cursive;

  /* Viewport Height fallback */
  --app-height: 100vh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@supports (height: 100dvh) {
  :root {
    --app-height: 100dvh;
  }
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  height: 100%;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  background: radial-gradient(ellipse at 50% 15%, #FFF6F0 0%, #FFE9DF 45%, #FFDDD1 80%, #F5D3E5 100%);
  color: var(--text-main);
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
  line-height: 1.6;
  touch-action: manipulation;
}

button,
.btn-flower-shower,
.btn-primary-action,
.btn-replay,
.music-btn {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ==========================================================================
   BACKGROUND CANVAS & SUNSET AURORA GLOW
   ========================================================================== */

#petal-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

.glow-top {
  top: -140px;
  right: -80px;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(255, 114, 94, 0.5) 0%, rgba(255, 160, 122, 0.35) 45%, rgba(255, 245, 240, 0) 70%);
  animation: pulseSunsetTop 8s ease-in-out infinite alternate;
}

.glow-bottom {
  bottom: -160px;
  left: -100px;
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(163, 112, 247, 0.35) 0%, rgba(255, 83, 118, 0.3) 50%, rgba(255, 245, 240, 0) 70%);
  animation: pulseSunsetBottom 10s ease-in-out infinite alternate;
}

@keyframes pulseSunsetTop {
  0% { transform: scale(1) translate(0, 0); opacity: 0.55; }
  100% { transform: scale(1.15) translate(-25px, 25px); opacity: 0.75; }
}

@keyframes pulseSunsetBottom {
  0% { transform: scale(1) translate(0, 0); opacity: 0.45; }
  100% { transform: scale(1.12) translate(25px, -20px); opacity: 0.65; }
}

/* ==========================================================================
   FLOATING MUSIC CONTROLLER (TOP RIGHT) - INTERACTIVE VINYL & EQUALIZER
   ========================================================================== */

.music-floating-container {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 100;
}

.music-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 3px 10px 3px 4px;
  background: rgba(255, 255, 255, 0.92);
  border: 1.5px solid var(--border-card);
  border-radius: 22px;
  box-shadow: 0 4px 16px rgba(255, 83, 118, 0.18), 0 2px 6px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.music-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 22px rgba(255, 83, 118, 0.3);
  border-color: var(--sunset-rose);
}

.music-btn:active {
  transform: scale(0.96);
}

/* Pulsing radar glow when playing */
.music-btn.playing {
  border-color: var(--sunset-rose);
  box-shadow: 0 4px 20px rgba(255, 83, 118, 0.35);
}

.music-btn.playing::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 26px;
  border: 1.5px solid rgba(255, 83, 118, 0.45);
  animation: musicRadarPulse 2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes musicRadarPulse {
  0% { transform: scale(0.96); opacity: 0.8; }
  50% { transform: scale(1.08); opacity: 0.3; }
  100% { transform: scale(1.14); opacity: 0; }
}

/* Vinyl Disc */
.vinyl-disc {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle, #25140D 35%, #44221A 70%, #160A06 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  animation: spinVinyl 4s linear infinite;
  animation-play-state: paused;
}

.music-btn.playing .vinyl-disc {
  animation-play-state: running;
}

.vinyl-disc::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.28);
}

.vinyl-center {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--sunset-amber);
  border: 1.5px solid #FFFFFF;
  box-shadow: 0 0 5px var(--sunset-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: all 0.25s ease;
}

/* Play triangle in the center when paused */
.icon-play-triangle {
  display: block;
  width: 0;
  height: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
  border-left: 5px solid #FFFFFF;
  margin-left: 1px;
  transition: opacity 0.2s ease;
}

.music-btn.playing .icon-play-triangle {
  opacity: 0;
  display: none;
}

.music-btn.playing .vinyl-center {
  background: #FF5376;
  box-shadow: 0 0 6px #FF5376;
}

@keyframes spinVinyl {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Soundwave Equalizer Bars */
.music-wave-bars {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 15px;
  padding-bottom: 1px;
}

.wave-bar {
  width: 3px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 114, 94, 0.35);
  transition: height 0.25s ease, background 0.25s ease;
}

.music-btn.playing .wave-bar {
  background: linear-gradient(180deg, #FF725E 0%, #FF5376 100%);
}

.music-btn.playing .wave-bar.bar-1 {
  animation: waveBounce1 0.7s ease-in-out infinite alternate;
}
.music-btn.playing .wave-bar.bar-2 {
  animation: waveBounce2 0.5s ease-in-out infinite alternate 0.15s;
}
.music-btn.playing .wave-bar.bar-3 {
  animation: waveBounce3 0.6s ease-in-out infinite alternate 0.3s;
}
.music-btn.playing .wave-bar.bar-4 {
  animation: waveBounce4 0.75s ease-in-out infinite alternate 0.05s;
}

@keyframes waveBounce1 {
  0% { height: 4px; }
  100% { height: 13px; }
}

@keyframes waveBounce2 {
  0% { height: 6px; }
  100% { height: 15px; }
}

@keyframes waveBounce3 {
  0% { height: 5px; }
  100% { height: 14px; }
}

@keyframes waveBounce4 {
  0% { height: 3px; }
  100% { height: 11px; }
}

/* Floating Musical Notes */
.music-notes-flow {
  position: absolute;
  top: -4px;
  left: 10px;
  pointer-events: none;
}

.float-note {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
}

.music-btn.playing .float-note.note-1 {
  color: #FF5376;
  animation: floatMusicNote 2.4s ease-out infinite;
}

.music-btn.playing .float-note.note-2 {
  color: #FFB703;
  animation: floatMusicNote 2.4s ease-out infinite 1.2s;
  left: 8px;
}

@keyframes floatMusicNote {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.6) rotate(0deg);
  }
  30% {
    opacity: 0.9;
    transform: translate(-6px, -12px) scale(1) rotate(-15deg);
  }
  70% {
    opacity: 0.7;
    transform: translate(4px, -24px) scale(1.1) rotate(15deg);
  }
  100% {
    opacity: 0;
    transform: translate(-3px, -34px) scale(0.8) rotate(30deg);
  }
}

/* ==========================================================================
   APP VIEWPORT & JOURNEY CARD FRAME
   ========================================================================== */

.app-viewport {
  width: 100%;
  height: var(--app-height);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  padding: 24px 16px 20px 16px;
}

.journey-card-frame {
  width: 100%;
  max-width: 540px;
  height: calc(var(--app-height) - 48px);
  max-height: 760px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   SCREENS BASE & TRANSITIONS
   ========================================================================== */

.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  opacity: 0;
  transform: translateY(20px) scale(0.97);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.screen.active {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.screen-content {
  width: 100%;
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 28px;
  padding: clamp(20px, 4vw, 36px) clamp(18px, 4vw, 32px);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Custom warm scrollbar */
.screen-content::-webkit-scrollbar {
  width: 4px;
}
.screen-content::-webkit-scrollbar-thumb {
  background: rgba(255, 114, 94, 0.3);
  border-radius: 4px;
}

/* ==========================================================================
   SHARED UI PILLS & BUTTONS
   ========================================================================== */

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(255, 83, 118, 0.1);
  border: 1px solid rgba(255, 83, 118, 0.28);
  border-radius: 24px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--sunset-rose);
  letter-spacing: 0.4px;
  width: fit-content;
  margin: 0 auto;
}

.btn-primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #FF5376 0%, #FF725E 50%, #FF9F1C 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #FFFFFF;
  border-radius: 18px;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 25px rgba(255, 83, 118, 0.4);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary-action::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  transition: 0.6s;
}

.btn-primary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 83, 118, 0.55);
  background: linear-gradient(135deg, #FF3D65 0%, #FF604B 50%, #FB8500 100%);
}

.btn-primary-action:hover::after {
  left: 140%;
}

.btn-primary-action:active {
  transform: translateY(1px);
}

/* ==========================================================================
   SCREEN 1: WELCOME & START JOURNEY
   ========================================================================== */

.welcome-content {
  text-align: center;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.hero-envelope-preview {
  position: relative;
  margin: 8px 0 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 3D Envelope Mockup Container */
.envelope-mockup {
  width: 210px;
  height: 135px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatEnvelope 4.5s ease-in-out infinite;
}

@keyframes floatEnvelope {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(1deg);
  }
}

/* Envelope Pocket Body */
.env-pocket {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 110px;
  background: linear-gradient(135deg, #FFF9F6 0%, #FFE9E0 100%);
  border-radius: 14px;
  border: 1.5px solid rgba(255, 114, 94, 0.28);
  box-shadow: 0 14px 35px rgba(255, 83, 118, 0.18), 0 3px 8px rgba(0, 0, 0, 0.04);
  z-index: 1;
}

/* Letter Paper peeking out */
.env-paper-peek {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 175px;
  height: 48px;
  background: #FFFFFF;
  border-radius: 8px 8px 0 0;
  border: 1px solid rgba(255, 183, 3, 0.35);
  border-bottom: none;
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.03);
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6px 16px;
  gap: 4px;
}

.paper-line {
  height: 2.5px;
  background: rgba(255, 114, 94, 0.25);
  border-radius: 2px;
  width: 100%;
}

.paper-line.short {
  width: 60%;
}

/* Top Flap folded down into center */
.env-flap-top {
  position: absolute;
  top: 25px;
  left: 0;
  width: 100%;
  height: 65px;
  background: linear-gradient(180deg, #FFE8E0 0%, #FFD6C8 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 14px 14px 0 0;
  filter: drop-shadow(0 4px 6px rgba(255, 83, 118, 0.16));
  z-index: 3;
}

/* Delicate Botanical Sprig tucked behind the seal */
.env-botanical-sprig {
  position: absolute;
  top: 50px;
  left: calc(50% + 14px);
  font-size: 1.35rem;
  transform: rotate(32deg);
  z-index: 4;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  pointer-events: none;
  animation: swaySprig 4.5s ease-in-out infinite;
}

@keyframes swaySprig {
  0%, 100% { transform: rotate(32deg) scale(1); }
  50% { transform: rotate(37deg) scale(1.05); }
}

/* Wax Seal sitting centered right at flap tip */
.wax-seal-hero {
  position: absolute;
  top: 86px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #FFA07A 0%, #FF5376 60%, #D8224D 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 83, 118, 0.45), 0 0 18px rgba(255, 160, 122, 0.35);
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  z-index: 5;
}

.wax-seal-hero::before {
  content: '';
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 83, 118, 0.45);
  animation: rotateSealRing 12s linear infinite;
}

.seal-initial {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: #FFFFFF;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.pulse-glow {
  animation: pulseSeal 2.8s ease-in-out infinite;
}

@keyframes pulseSeal {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 8px 24px rgba(255, 83, 118, 0.45);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.06);
    box-shadow: 0 12px 32px rgba(255, 83, 118, 0.65), 0 0 25px rgba(255, 160, 122, 0.5);
  }
}

@keyframes rotateSealRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.welcome-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 5.5vw, 2.4rem);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.highlight-name {
  background: linear-gradient(135deg, #FF3D65 0%, #FF725E 50%, #FF9F1C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  position: relative;
}

.welcome-desc {
  font-size: clamp(0.92rem, 2.6vw, 1.02rem);
  color: var(--text-body);
  line-height: 1.75;
  max-width: 420px;
}

.birthday-content {
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.birthday-symbol { font-size: 2.5rem; }
.birthday-eyebrow {
  color: var(--sunset-rose);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
}
.birthday-form { width: 100%; max-width: 360px; }
.birthday-label { display: block; font-size: 0.85rem; color: var(--text-body); }
.birthday-code-wrap { position: relative; width: min(100%, 272px); margin: 14px auto; }
.birthday-code {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: text;
  font-size: 20px;
}
.birthday-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; pointer-events: none; }
.birthday-slots span {
  display: grid;
  place-items: center;
  height: 64px;
  border: 1px solid var(--border-card);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--sunset-rose);
  font-size: 1.65rem;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}
.birthday-code-wrap:focus-within .birthday-slots span {
  border-color: var(--sunset-rose);
  box-shadow: 0 0 0 2px rgba(255, 83, 118, 0.12);
}
.birthday-feedback { min-height: 64px; margin-bottom: 14px; font-size: 0.82rem; color: var(--text-muted); }
.code-error .birthday-feedback { color: #AC3750; }
.code-error .birthday-slots span { border-color: #AC3750; background: #FFF0F2; }
.code-success .birthday-feedback { color: #277349; }
.code-success .birthday-slots span { border-color: #5A9C77; background: #EFFAF3; color: #277349; }
.birthday-form .btn-primary-action:disabled { opacity: 0.7; cursor: default; }
.birthday-back {
  display: block;
  margin: 16px auto 0;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}
.birthday-back:focus-visible { outline: 2px solid var(--sunset-rose); border-radius: 8px; }

.welcome-actions {
  width: 100%;
  max-width: 380px;
  margin-top: 6px;
}

/* ==========================================================================
   SCREEN 2: TYPEWRITER WISHES
   ========================================================================== */

.letter-content {
  --letter-ink: #29465B;
  --letter-accent: #3B637C;
  gap: 14px;
  justify-content: flex-start;
}

.letter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--letter-accent);
  letter-spacing: 0.2px;
  margin: 0 auto;
  flex-shrink: 0;
}

/* This heading receives focus when the letter opens; it is not a control. */
.letter-badge:focus { outline: none; }

.letter-badge i {
  width: 16px;
  height: 16px;
}

.typewriter-box {
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  background: #FFFBF6;
  border: 1px solid #E8DADE;
  border-radius: 20px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  overflow: visible;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
  cursor: pointer;
}

.letter-head-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #EADDE1;
  padding-bottom: 6px;
  margin-bottom: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.date-chip {
  font-style: italic;
}

.recipient-chip {
  font-weight: 600;
  color: var(--letter-accent);
}

.typewriter-body {
  font-family: var(--font-letter);
  font-size: clamp(0.92rem, 2.6vw, 1rem);
  color: var(--letter-ink);
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: normal;
  white-space: normal;
  word-wrap: break-word;
}

.typewriter-text {
  display: inline;
}

.type-cursor {
  display: inline-block;
  color: var(--letter-accent);
  font-weight: 400;
  animation: blinkCursor 0.75s infinite;
  margin-left: 2px;
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.typewriter-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.hidden-until-ready {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hidden-until-ready.show-button {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  animation: softBounce 1.5s ease-in-out infinite alternate;
}

@keyframes softBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

/* A glass photo prism in the top layer, above the gift cards and petals. */
.photo-dialog {
  --photo-size: min(76vw, 44dvh, 340px);
  --photo-depth: calc(var(--photo-size) * 0.288675);
  width: min(94vw, 540px);
  max-height: 94dvh;
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid #fff9;
  border-radius: 28px;
  color: #fff0f5;
  background: radial-gradient(ellipse at 15% 25%, #77366066, transparent 60%), radial-gradient(ellipse at 100% 80%, #4c3b7b88, transparent 60%), #20152f;
  box-shadow: 0 30px 100px #10091acc, 0 0 60px #c184c42b, inset 0 0 55px #ee9dd712;
}

.photo-dialog::backdrop { background: #120b20cf; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.photo-dialog-content { position: relative; text-align: center; padding: 32px 20px 24px; }
.photo-dialog[open] .photo-dialog-content { animation: photoEntrance .7s ease-out both; }
.photo-close {
  position: absolute; top: 10px; right: 12px; width: 44px; height: 44px;
  display: grid; place-items: center; border: 1px solid #d5b0c455; border-radius: 50%;
  background: #ffffff0d; color: #f6d4e8; font-size: 28px; cursor: pointer;
}
.photo-eyebrow { margin: 8px 35px 12px; color: #e2b78f; font: 600 10px/1.6 var(--font-sans); letter-spacing: 2px; }
.photo-dialog h2 { margin: 0; font-family: var(--font-display); font-size: clamp(22px, 5.5vw, 30px); line-height: 1.3; text-shadow: 0 0 24px #ffbfe366; }
.photo-intro { margin: 9px 0 0; font-size: 12px; color: #d0b4ce; }
.photo-scene {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: calc(var(--photo-size) * 1.45 + 55px);
  margin: 12px 0 0;
  perspective: 1100px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: grab;
}
.photo-scene::after {
  content: ''; position: absolute; bottom: 5px; left: 20%; right: 20%; height: 22px;
  border-radius: 50%; background: radial-gradient(ellipse, #e4a1e755, transparent 70%);
  pointer-events: none;
}
.photo-scene.is-dragging { cursor: grabbing; }
.photo-float {
  position: relative;
  width: var(--photo-size);
  height: calc(var(--photo-size) * 1.3);
  transform-style: preserve-3d;
  animation: photoLevitate 6s ease-in-out infinite;
}
.photo-prism {
  position: relative;
  width: var(--photo-size);
  height: calc(var(--photo-size) * 1.3);
  transform-style: preserve-3d;
  transform: translateZ(calc(-1 * var(--photo-depth))) rotateX(var(--tilt-x, 0deg)) rotateY(calc(var(--rotation, 0deg) + var(--tilt-y, 0deg)));
  transition: transform 850ms cubic-bezier(.22, .8, .25, 1);
}
.is-dragging .photo-prism { transition: none; }
.photo-face {
  position: absolute; inset: 0; margin: 0; padding: 9px 9px 30px;
  border: 1px solid #ffe6f1c9; border-radius: 15px;
  background: linear-gradient(135deg, #f9dcf3, #aa81ad 45%, #e3cefa);
  box-shadow: inset 0 0 0 3px #ffffff60, 0 0 18px #f6c9e965, 0 0 48px #ed9eda30;
  transform: rotateY(calc(var(--face) * 120deg)) translateZ(var(--photo-depth));
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.photo-face img { display: block; width: 100%; height: 100%; object-fit: contain; background: #291c36; border-radius: 8px; pointer-events: none; }
.photo-face figcaption { position: absolute; bottom: 7px; left: 5px; right: 5px; font-size: 10px; color: #43283f; }
.photo-face::before {
  content: ''; position: absolute; inset: -2px; padding: 2px; border-radius: 17px; pointer-events: none;
  background: conic-gradient(from var(--photo-glow-angle, 0deg), #ffdc9b, #ef9fff, #ffffff, #a4caff, #ffb4d8, #ffdc9b);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  animation: photoBorderFlow 7s linear infinite;
}
.photo-face::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--light-x, 20%) var(--light-y, 20%), #ffe4ff33, transparent 60%), linear-gradient(115deg, transparent 30%, #fff1 42%, #fff5 47%, transparent 58%);
  background-size: 300% 100%; animation: photoShimmer 5s ease-in-out infinite;
}
.photo-controls { display: flex; align-items: center; justify-content: center; gap: 22px; position: relative; }
.photo-controls > button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #dfbed355; background: #ffffff0b; color: #f3d8e9; font-size: 22px; cursor: pointer; transition: background .2s, box-shadow .2s; }
.photo-controls > button:hover { background: #ffffff20; box-shadow: 0 0 20px #e5a5d033; }
.photo-dots { display: flex; gap: 0; }
.photo-dots button { display: grid; place-items: center; width: 30px; height: 44px; border: 0; background: transparent; cursor: pointer; }
.photo-dots button::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #806480; transition: background .2s, transform .2s; }
.photo-dots button[aria-pressed="true"]::after { background: #ffdfb6; box-shadow: 0 0 12px #ffcbe7; transform: scale(1.4); }
.photo-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  .photo-dialog { --photo-size: min(82vw, 44dvh, 360px); width: 98vw; max-height: 98dvh; border-radius: 22px; }
  .photo-dialog-content { padding: 22px 12px 14px; }
  .photo-eyebrow { margin-bottom: 8px; }
  .photo-dialog h2 { font-size: clamp(20px, 5.3vw, 28px); }
  .photo-scene { height: calc(var(--photo-size) * 1.3 + 55px); margin-top: 4px; }
  .photo-face { padding: 6px 6px 27px; }
}
.photo-dialog button:focus-visible, .photo-scene:focus-visible { outline: 2px solid #b272a0; outline-offset: 3px; }
@keyframes photoShimmer { 0%, 15% { background-position: 100% 0; } 65%, 100% { background-position: 0% 0; } }
.photo-aura {
  position: absolute; width: 100%; height: 100%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at 35% 45%, #f984c942, transparent 55%), radial-gradient(ellipse at 65% 55%, #ae93ff55, transparent 55%);
  filter: blur(20px); animation: photoAurora 9s ease-in-out infinite alternate;
}
.photo-orbit {
  position: absolute; width: 92%; height: 60%; border: 1px solid #efb8ef40; border-radius: 50%;
  box-shadow: 0 0 12px #d9a6ff18, inset 0 0 12px #d9a6ff18; pointer-events: none;
}
.photo-orbit::before, .photo-orbit::after {
  content: ''; position: absolute; left: 15%; top: 12%; width: 5px; height: 5px; border-radius: 50%;
  background: #ffe3b6; box-shadow: 0 0 8px #fff, 0 0 18px #ffb8ea;
}
.photo-orbit::after { left: auto; top: auto; right: 15%; bottom: 12%; width: 3px; height: 3px; }
.photo-orbit-one { transform: rotate(-28deg) rotateX(56deg); animation: photoOrbitOne 12s ease-in-out infinite alternate; }
.photo-orbit-two { width: 86%; height: 76%; transform: rotate(38deg) rotateX(48deg); border-color: #e5ba8c33; animation: photoOrbitTwo 15s ease-in-out infinite alternate; }
.photo-floor {
  position: absolute; bottom: 11px; width: 82%; height: 45px; border-radius: 50%; pointer-events: none;
  border: 1px solid #f5ccf054; background: radial-gradient(ellipse, #ec92db38, #b998ff15 45%, transparent 70%);
  box-shadow: 0 0 25px #ec92db33, inset 0 0 18px #e8a3e52b;
  animation: photoFloorPulse 4s ease-in-out infinite;
}
.photo-reflection {
  position: absolute; left: calc(50% - var(--photo-size) / 2); top: calc(50% + var(--photo-size) * .65 + 4px);
  width: var(--photo-size); height: 48px; overflow: hidden; opacity: .25; pointer-events: none;
  mask-image: linear-gradient(#0009, transparent); -webkit-mask-image: linear-gradient(#0009, transparent);
  filter: blur(1px);
}
.photo-reflection img { width: 100%; height: calc(var(--photo-size) * 1.3); object-fit: contain; transform: scaleY(-1); }
.photo-dust { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
@property --photo-glow-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes photoBorderFlow { to { --photo-glow-angle: 360deg; } }
@keyframes photoLevitate { 0%, 100% { transform: translateY(3px) rotateZ(-1deg); } 50% { transform: translateY(-7px) rotateZ(1deg); } }
@keyframes photoAurora { from { transform: scale(.9) rotate(-15deg); opacity: .65; } to { transform: scale(1.15) rotate(20deg); opacity: 1; } }
@keyframes photoOrbitOne { to { transform: rotate(10deg) rotateX(65deg); } }
@keyframes photoOrbitTwo { to { transform: rotate(65deg) rotateX(35deg); } }
@keyframes photoFloorPulse { 50% { opacity: .5; transform: scaleX(.9); } }
@keyframes photoEntrance { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
.photo-dialog:not([open]) *, .photo-dialog:not([open]) *::before, .photo-dialog:not([open]) *::after { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .photo-dialog *, .photo-dialog *::before, .photo-dialog *::after { animation: none !important; }
  .photo-prism { transition-duration: 0.01ms; }
}

/* ==========================================================================
   SCREEN 4: FINAL INTERACTION & WARM CLOSING
   ========================================================================== */

.ending-content {
  text-align: center;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ending-flower-burst {
  font-size: 2.5rem;
  animation: pulseFlower 2s ease-in-out infinite alternate;
}

@keyframes pulseFlower {
  from { transform: scale(0.95); }
  to { transform: scale(1.1); filter: drop-shadow(0 0 12px rgba(255, 83, 118, 0.4)); }
}

.ending-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4.5vw, 1.85rem);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
}

.ending-message {
  font-size: clamp(0.9rem, 2.5vw, 0.98rem);
  color: var(--text-body);
  line-height: 1.7;
  max-width: 440px;
}

.flower-interactive-box {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 14px;
}

.btn-flower-shower {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  background: linear-gradient(135deg, #FF725E 0%, #FF5376 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(255, 83, 118, 0.38);
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.btn-flower-shower:active {
  transform: scale(0.95);
}

.btn-flower-shower i {
  width: 18px;
  height: 18px;
}

.flower-counter {
  font-size: 0.82rem;
  color: var(--sunset-rose);
  font-weight: 600;
}

.ending-signature {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sig-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.sig-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--sunset-rose);
}

.signature-heart {
  display: inline-block;
  animation: heart-beat 1.8s ease-in-out infinite;
}

@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .signature-heart { animation: none; }
}

.btn-replay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(255, 114, 94, 0.3);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-replay:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-main);
  border-color: var(--sunset-rose);
}

.btn-replay i {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   TAP / CLICK FLOATING HEARTS & PARTICLES
   ========================================================================== */

.floating-particle {
  position: fixed;
  pointer-events: none;
  font-size: 1.35rem;
  z-index: 9999;
  animation: floatUpAndFade 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px rgba(255, 114, 94, 0.5));
}

@keyframes floatUpAndFade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.6);
  }
  50% {
    opacity: 0.95;
    transform: translate(-50%, -100px) scale(1.25);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -140px) scale(1.5);
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN (PC, LAPTOP, TABLET, MOBILE)
   ========================================================================== */

/* Laptop & Desktop adjustments */
@media (min-width: 768px) {
  .journey-card-frame {
    max-width: 580px;
  }

  .screen-content {
    border-radius: 32px;
    padding: 38px 40px;
  }

  .welcome-desc {
    font-size: 1.05rem;
  }
  
  .typewriter-box {
    padding: 24px 26px;
  }

}

/* Very Small Mobile Screens (iPhone SE / 360px) */
@media (max-height: 670px) {
  .app-viewport {
    padding-top: 50px;
    padding-bottom: 12px;
  }

  .journey-card-frame {
    height: calc(var(--app-height) - 64px);
  }

  .screen-content {
    padding: 16px 14px;
    gap: 8px;
    border-radius: 20px;
  }

  .welcome-content {
    gap: 10px;
  }

  .envelope-mockup {
    width: 175px;
    height: 115px;
  }

  .env-pocket {
    height: 92px;
  }

  .env-paper-peek {
    width: 145px;
    height: 38px;
  }

  .env-flap-top {
    height: 52px;
  }

  .wax-seal-hero {
    top: 72px;
    width: 56px;
    height: 56px;
  }
  
  .seal-initial {
    font-size: 1.35rem;
  }

  .typewriter-box {
    padding: 12px 14px;
  }

  .typewriter-body {
    font-size: 0.95rem;
    line-height: 1.8;
  }

  .letter-head-info {
    margin-bottom: 6px;
    padding-bottom: 4px;
  }
}

/* A small keepsake: letter, photographs, flowers. */
[hidden] { display: none !important; }
button { font-family: inherit; }
button:focus-visible, input:focus-visible, [role="button"]:focus-visible {
  outline: 3px solid #a75476;
  outline-offset: 5px;
}
h1:focus, h2:focus { outline: none; }
.app-viewport {
  padding: calc(52px + var(--safe-top)) max(16px, env(safe-area-inset-right)) calc(18px + var(--safe-bottom)) max(16px, env(safe-area-inset-left));
}
.journey-card-frame {
  height: calc(var(--app-height) - 70px - var(--safe-top) - var(--safe-bottom));
  max-height: 780px;
}
.music-floating-container { top: calc(12px + var(--safe-top)); right: max(14px, env(safe-area-inset-right)); }
.screen-content {
  background: radial-gradient(ellipse at 90% 0, #fff3ebaa, transparent 55%), #fffdf8ed;
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
}
.screen-content > * { flex-shrink: 0; }
.little-eyebrow { color: #a26663; font: 600 9px/1.8 var(--font-sans); letter-spacing: 1.9px; text-align: center; }
.welcome-content { gap: 24px; padding-top: 30px; padding-bottom: 30px; }
.welcome-desc { max-width: 350px; font-family: var(--font-letter); font-size: 14px; line-height: 1.9; }
.screen.active .welcome-title, .screen.active .album-header, .screen.active .ending-title {
  animation: keepsakeEnter .65s cubic-bezier(.2,.7,.3,1) both;
}
.screen.active .album-stage { animation: keepsakeEnter .8s .1s both; }
@keyframes keepsakeEnter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.letter-content { padding-top: 30px; gap: 22px; }
.letter-badge { color: #9e5d6c; }
.typewriter-box { background: linear-gradient(100deg, #fffdf9, #fff9f2); border-color: #ead9d4; box-shadow: 0 6px 24px #98605209; }
.typewriter-body { font-size: clamp(14px, 2.6vw, 16px); line-height: 1.9; }
.letter-head-info { gap: 8px; font-size: 10px; }
.typewriter-actions { margin-top: auto; padding-top: 6px; }
.letter-skip { align-self: center; min-height: 44px; padding: 8px 16px; border: 0; background: transparent; color: #95706b; font-size: 11px; cursor: pointer; }
.hidden-until-ready.show-button { animation: none; }

/* Three printed photographs peeking out of a warm paper envelope. */
.album-content { text-align: center; align-items: center; justify-content: flex-start; gap: 16px; padding-top: 28px; }
.album-header { width: 100%; }
.album-header h2 { margin: 14px 0 12px; font: 600 clamp(32px, 7vw, 43px)/1.15 var(--font-display); color: #533a37; letter-spacing: -.7px; }
.album-header h2 em { font-weight: 400; color: #b35e70; }
.album-intro { max-width: 320px; margin: 0 auto; font-family: var(--font-letter); font-size: 12px; line-height: 1.8; color: #8e6b63; text-wrap: pretty; }
.album-stage { width: 100%; flex: 1 0 295px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 8px; isolation: isolate; }
.album-halo { position: absolute; width: 100%; max-width: 370px; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(ellipse, #f5c0ac50 0%, #ffecd87a 36%, transparent 68%); z-index: -1; animation: albumGlow 6s ease-in-out infinite alternate; pointer-events: none; }
.album-envelope { --envelope-width: min(260px, 64vw); width: var(--envelope-width); height: calc(var(--envelope-width) * .85); position: relative; display: block; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; isolation: isolate; }
.album-envelope-back { position: absolute; inset: 28% 0 0; border-radius: 12px; background: linear-gradient(150deg, #e7bb9f, #f3d0b2); box-shadow: 0 22px 35px -18px #91654777; }
.album-preview { position: absolute; left: 50%; top: 0; width: 46%; height: 74%; padding: 6px 6px 24px; border: 1px solid #e8d9cc; border-radius: 3px; background: #fffdf6; box-shadow: 0 5px 16px #8f62582b; pointer-events: none; transition: transform .65s cubic-bezier(.2,.8,.25,1); }
.album-preview img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 1px; }
.preview-left { transform: translate(-93%, 6px) rotate(-17deg); }
.preview-right { transform: translate(-5%, 4px) rotate(16deg); }
.preview-center { transform: translate(-50%, -9px) rotate(-3deg); }
.preview-center > span { position: absolute; left: 0; right: 0; bottom: 5px; font-size: 8px; letter-spacing: .4px; color: #9b7565; }
.album-envelope-front { position: absolute; inset: 44% 0 0; border: 1px solid #ddb79b; border-radius: 4px 4px 12px 12px; background: linear-gradient(150deg, #f6dfc8, #eed0af); box-shadow: inset 0 1px 0 #fff8; overflow: hidden; }
.album-envelope-front::before, .album-envelope-front::after { content: ''; position: absolute; width: 70%; height: 160%; top: -65%; border: 1px solid #d7ac8745; transform: rotate(40deg); background: linear-gradient(130deg, #f9e4cf, #f3d7b9); }
.album-envelope-front::before { left: -29%; }
.album-envelope-front::after { right: -29%; transform: rotate(-40deg); }
.album-envelope-label { position: absolute; left: 0; right: 0; bottom: 18%; color: #8c6657; font-family: var(--font-display); font-size: 15px; font-style: italic; pointer-events: none; }
.album-envelope-label > span { display: block; font-style: normal; font-size: 17px; margin-top: 2px; color: #b37b67; }
.album-seal { position: absolute; right: 15px; bottom: 12px; width: 31px; height: 31px; display: grid; place-items: center; background: #b65e62; color: #f9dec9; border: 3px double #da9b8f; border-radius: 50%; font: 14px var(--font-display); transform: rotate(12deg); box-shadow: 0 2px 4px #7a393a24; pointer-events: none; }
.album-open-hint { margin-top: 17px; color: #aa6e64; font: 11px/1.8 var(--font-letter); }
.album-open-hint span { display: inline-block; margin-left: 3px; animation: hintNudge 2.5s ease-in-out infinite; }
.album-envelope.is-opening .preview-left { transform: translate(-112%, -38px) rotate(-23deg); }
.album-envelope.is-opening .preview-right { transform: translate(13%, -32px) rotate(24deg); }
.album-envelope.is-opening .preview-center { transform: translate(-50%, -52px) rotate(0deg) scale(1.07); }
.album-envelope.is-opened .preview-left { transform: translate(-100%, -7px) rotate(-20deg); }
.album-envelope.is-opened .preview-right { transform: translate(0, -8px) rotate(20deg); }
.album-footer { width: 100%; display: flex; flex-direction: column; gap: 15px; }
.album-footnote { font-size: 9px; color: #a0867d; line-height: 1.8; }
@media (hover: hover) and (pointer: fine) {
  .album-envelope:hover .preview-center { transform: translate(-50%, -26px) rotate(0deg); }
  .album-envelope:hover .preview-left { transform: translate(-105%, -4px) rotate(-21deg); }
  .album-envelope:hover .preview-right { transform: translate(5%, -4px) rotate(21deg); }
}
@keyframes albumGlow { from { opacity: .6; transform: scale(.9); } to { opacity: 1; transform: scale(1.05); } }
@keyframes hintNudge { 0%, 80%, 100% { transform: translate(0, 0); } 90% { transform: translate(2px, -3px); } }

/* Keep photo controls on screen on a laptop and on a small iPhone. */
.photo-dialog { --photo-size: min(69vw, 34vh, 290px); max-height: 94vh; width: min(94vw, 540px); }
@supports (height: 100dvh) {
  .photo-dialog { --photo-size: min(69vw, 34dvh, 290px); max-height: calc(100dvh - 20px - var(--safe-top) - var(--safe-bottom)); }
}
.photo-dialog-content { padding: 24px 18px 20px; }
.photo-eyebrow { font-size: 8px; letter-spacing: 1.5px; margin-top: 10px; }
.photo-dialog h2 { padding: 0 24px; font-size: clamp(20px, 4.5vw, 28px); }
.photo-intro { font-size: 11px; min-height: 20px; }
.photo-scene { height: calc(var(--photo-size) * 1.4 + 35px); margin-top: 8px; }
.photo-status { position: static; width: auto; height: auto; padding: 0; margin: 8px 0 0; clip-path: none; overflow: visible; font-size: 10px; letter-spacing: 2px; color: #dfbecb; }
.photo-help { margin: 10px 0 16px; font-size: 10px; color: #cdb4c9; line-height: 1.8; }
.touch-hint { display: none; }
@media (pointer: coarse) { .touch-hint { display: inline; } .pointer-hint { display: none; } }
.photo-done { min-height: 44px; max-width: 100%; padding: 12px 18px; border: 1px solid #e7b0bc66; border-radius: 13px; background: linear-gradient(120deg, #7f456a66, #b06c7f33); color: #fbe4e9; cursor: pointer; font-size: 11px; line-height: 1.7; transition: background .2s; }
.photo-done span { padding-left: 7px; }
.photo-done:hover { background: #985e7d88; }
.photo-dots button { width: 44px; }

/* A little bouquet, with a fresh bloom each time more flowers are sent. */
.ending-content { gap: 15px; justify-content: flex-start; padding-top: 26px; padding-bottom: 26px; }
.ending-title { font-size: clamp(30px, 6vw, 39px); font-weight: 500; color: #704849; line-height: 1.2; }
.ending-message { font: 12px/1.9 var(--font-letter); color: #92716a; }
.bouquet-scene { position: relative; width: min(300px, 100%); height: 252px; isolation: isolate; margin: -10px auto 0; }
.bouquet-glow { position: absolute; inset: 7% -5% 0; z-index: -1; border-radius: 50%; background: radial-gradient(ellipse, #f4c9bb70, #fae3cb33 45%, transparent 70%); pointer-events: none; }
.bouquet-photo-wrap { width: 100%; height: 100%; }
.bouquet-photo { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; filter: drop-shadow(0 10px 12px #86574718); transform-origin: 50% 85%; }
.screen.active .bouquet-photo-wrap { animation: bouquetPhotoEntrance 1s cubic-bezier(.2,.7,.3,1) both; }
.screen.active .bouquet-photo { animation: bouquetFloat 7s ease-in-out infinite; }
.screen.active .bouquet-glow { animation: albumGlow 5s ease-in-out infinite alternate; }
.screen.active .is-blooming .bouquet-photo-wrap { animation: bouquetPhotoPulse .85s ease-out both; }
.bouquet-ripple { position: absolute; inset: 2% 4% 12%; border: 1px solid #d78d9b60; border-radius: 50%; opacity: 0; pointer-events: none; z-index: -1; }
.screen.active .is-blooming .bouquet-ripple { animation: bouquetRipple 1.5s ease-out both; }
.bouquet-drifting-petal, .bouquet-loose-petal { position: absolute; width: 11px; height: 15px; border-radius: 75% 15% 65% 35%; background: linear-gradient(145deg, #f9c7cc, #d78399); pointer-events: none; opacity: 0; }
.petal-one { left: 17%; top: 26%; --petal-drift: -28px; --petal-delay: 1.3s; }
.petal-two { right: 17%; top: 33%; --petal-drift: 32px; --petal-delay: 3.7s; width: 9px; height: 12px; }
.petal-three { left: 31%; top: 14%; --petal-drift: -44px; --petal-delay: 6s; width: 8px; height: 11px; }
.petal-four { right: 25%; top: 19%; --petal-drift: 42px; --petal-delay: 8s; }
.screen.active .bouquet-drifting-petal { animation: bouquetPetalDrift 8s var(--petal-delay) ease-in-out infinite; }
.bouquet-loose-petal { left: 50%; top: 40%; z-index: 2; animation: bouquetPetalBurst 1.9s var(--petal-delay, 0s) cubic-bezier(.2,.6,.3,1) both; }
.flower-interactive-box { max-width: 350px; background: #fff9f0; border-color: #ecdacf; padding: 13px; gap: 12px; }
.flower-counter { font-size: 10px; color: #ae7376; font-weight: 500; }
.sig-note { font-size: 10px; line-height: 1.9; }
.sig-name { font-size: 20px; font-style: italic; color: #a75c6f; margin-top: 5px; }
.btn-replay { min-height: 44px; border-color: transparent; font-size: 10px; }
@keyframes bouquetFloat { 0%, 100% { transform: translateY(2px) rotate(-.6deg); } 50% { transform: translateY(-4px) rotate(.6deg); } }
@keyframes bouquetPhotoEntrance { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes bouquetPhotoPulse { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.035); } }
@keyframes bouquetRipple { from { opacity: .7; transform: scale(.6); } to { opacity: 0; transform: scale(1.3); } }
@keyframes bouquetPetalDrift { 0%, 12% { opacity: 0; transform: translate(0, -10px) rotate(0deg); } 20% { opacity: .75; } 65% { opacity: 0; transform: translate(var(--petal-drift), 105px) rotate(160deg); } 100% { opacity: 0; transform: translate(var(--petal-drift), 105px) rotate(160deg); } }
@keyframes bouquetPetalBurst { 0% { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(.4); } 15% { opacity: .9; } 65% { opacity: .8; } 100% { opacity: 0; transform: translate(var(--petal-x), var(--petal-y)) rotate(var(--petal-turn)) scale(.8); } }

@media (max-width: 380px) {
  .album-header h2 { font-size: 32px; }
  .photo-dialog-content { padding-left: 10px; padding-right: 10px; }
}
@media (max-height: 740px) {
  .screen-content { padding: 22px 20px; }
  .welcome-content { gap: 16px; }
  .album-content { gap: 10px; }
  .album-header h2 { margin-top: 10px; font-size: 32px; }
  .album-stage { flex-basis: 245px; }
  .album-envelope { --envelope-width: min(218px, 61vw); }
  .album-open-hint { margin-top: 12px; font-size: 10px; }
  .album-footer { gap: 10px; }
  .bouquet-scene { width: min(245px, 100%); height: 210px; margin-top: -12px; margin-bottom: -4px; }
  .ending-content { gap: 10px; }
  .ending-title { font-size: 30px; }
  .photo-dialog-content { padding-top: 18px; padding-bottom: 14px; }
  .photo-eyebrow { margin-bottom: 8px; }
  .photo-help { margin: 6px 0 10px; }
}
@media (max-height: 500px) {
  .screen-content { justify-content: flex-start; }
  .album-stage { flex-grow: 0; }
  .welcome-content { padding-top: 25px; padding-bottom: 25px; }
  .birthday-content { padding-top: 16px; }
  .photo-dialog { --photo-size: min(46vw, 36vh, 170px); }
  .photo-dialog h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
