/* =========================================================================================
 * NỀN TẢNG: màu, font, nền trang, khung cảnh, nút bấm, hiệu ứng dùng chung
 * ========================================================================================= */
:root {
  --bg: #fff6f1;
  --bg-2: #ffe6ec;
  --card: #fffdfb;
  --ink: #3e2a34;
  --muted: #8c6f7b;
  --rose: #e2557f;
  --rose-deep: #b8355f;
  --rose-soft: #ffd3df;
  --gold: #e7a93c;
  --sage: #6fa35f;
  --shadow: 0 14px 34px rgba(150, 70, 100, 0.16);
  --shadow-sm: 0 6px 16px rgba(150, 70, 100, 0.14);
  --radius: 20px;
  --font-hand: "Dancing Script", cursive;
  --font-body: "Quicksand", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: radial-gradient(120% 80% at 50% 0%, #fffaf6 0%, var(--bg) 45%, var(--bg-2) 100%) fixed;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

#petals {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
}

/* ---------------------------------------------------------------- Khung cảnh & chuyển cảnh */
.scene {
  position: absolute;
  inset: 0;
  min-height: 100dvh;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0s linear 0.6s;
}

.scene.active {
  position: relative;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.scene-inner {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.scene-inner.center {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.scene-head {
  text-align: center;
}

.scene-head h2,
.letter h2 {
  margin: 4px 0 2px;
  font-family: var(--font-hand);
  font-size: 2.3rem;
  font-weight: 700;
  color: var(--rose-deep);
  line-height: 1.1;
}

.eyebrow {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hint {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---------------------------------------------------------------- Nút bấm */
.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
}

.actions.column {
  flex-direction: column;
  align-items: center;
}

.btn {
  font: 600 1rem var(--font-body);
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

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

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #ef6f96, var(--rose-deep));
  box-shadow: 0 10px 22px rgba(184, 53, 95, 0.32);
}

.btn.ghost {
  color: var(--rose-deep);
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1.5px var(--rose-soft);
}

.btn[hidden] {
  display: none;
}

.btn:focus-visible,
.shelf-item:focus-visible,
.envelope:focus-visible,
.film:focus-visible {
  outline: 3px solid #f59bb7;
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- Hiệu ứng dùng chung */
.pop-in {
  animation: popIn 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
