* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --pink: #ffb3d1;
  --pink-light: #ffe0ef;
  --blue: #a8d8ff;
  --blue-light: #e0f0ff;
  --purple: #c9b6ff;
  --text-dark: #4a3f55;
  --text-soft: #7a6f85;
  --yellow: #ffd86b;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Quicksand', sans-serif;
  background: linear-gradient(135deg, var(--pink-light) 0%, var(--blue-light) 50%, #fff0f5 100%);
  color: var(--text-dark);
}

h1, h2, .title {
  font-family: 'Baloo 2', cursive;
}

#app {
  position: relative;
  width: 100%;
  height: 100vh;
}

.page {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease, visibility 0.5s;
  overflow-y: auto;
}

.page.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.page-inner {
  max-width: 480px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 8px 40px;
}

/* Character placeholder — replace .char-placeholder content with <img> later */
.char-slot {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.char-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 8px 20px rgba(201, 182, 255, 0.4);
  animation: float 3s ease-in-out infinite;
}

.char-placeholder {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: 3px dashed var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.title {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-dark);
}

.subtitle {
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-soft);
}

.hint {
  font-size: 14px;
  color: var(--text-soft);
  opacity: 0.8;
}

.btn-next {
  margin-top: 12px;
  padding: 14px 32px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  color: white;
  font-family: 'Baloo 2', cursive;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(201, 182, 255, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-next:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 24px rgba(201, 182, 255, 0.55);
}

.btn-next:active {
  transform: scale(0.97);
}

/* Info card - page 2 */
.info-card {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 20px;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
}

.info-icon {
  font-size: 22px;
}

.quote {
  font-style: italic;
  color: var(--text-soft);
  font-size: 16px;
  padding: 0 12px;
}

/* Timeline - page 2 */
.timeline-caption {
  font-size: 15px;
  color: var(--text-soft);
  padding: 0 8px;
}

.timeline-image-wrap {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(201, 182, 255, 0.3);
}

.timeline-image {
  width: 100%;
  display: block;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 16px 18px;
}

.timeline-row {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dark);
}

.timeline-year {
  display: inline-block;
  font-weight: 700;
  color: #e0558f;
  margin-right: 6px;
}

.timeline-row.highlight {
  font-weight: 600;
  padding-top: 6px;
  border-top: 1px dashed rgba(201, 182, 255, 0.5);
  margin-top: 4px;
}

/* Facts - page 3 */
.fact-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  text-align: left;
}

.fact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 16px;
  padding: 14px 16px;
}

.fact-emoji {
  font-size: 26px;
  flex-shrink: 0;
}

.fact-item p {
  font-size: 15px;
  line-height: 1.5;
}

/* Gallery - page 4 */
.page-inner-wide {
  max-width: 720px;
}

.gallery-caption {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-soft);
  padding: 0 8px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

@media (min-width: 560px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery-photo {
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(201, 182, 255, 0.3);
  transition: transform 0.25s ease;
}

.gallery-photo:hover {
  transform: scale(1.03);
}

.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Sincere page 5 */
.sincere-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dark);
  padding: 0 8px;
}

.sincere-text-highlight {
  font-size: 19px;
  font-weight: 700;
  color: #e0558f;
  margin-top: 4px;
}

/* Final page 6 */
.final-title {
  font-size: 28px;
}

.final-buttons {
  display: flex;
  gap: 20px;
  margin-top: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-yes {
  padding: 16px 36px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8fb1, #ff6b9d);
  color: white;
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 107, 157, 0.45);
  transition: transform 0.2s;
}

.btn-yes:hover {
  transform: scale(1.06);
}

.btn-no {
  padding: 16px 36px;
  border: 2px solid #c9b6ff;
  border-radius: 999px;
  background: white;
  color: var(--text-soft);
  font-family: 'Quicksand', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease;
}

.no-nudge {
  font-size: 14px;
  color: var(--text-soft);
  font-style: italic;
  min-height: 20px;
  margin-top: 4px;
}

/* Result overlay */
.result-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #ffe0ef, #e0f0ff);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 24px;
}

.result-overlay.show {
  display: flex;
}

.result-card {
  max-width: 440px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.result-card h2 {
  font-size: 32px;
  color: #e0558f;
}

.result-card p {
  font-size: 17px;
  line-height: 1.6;
}

.contact-placeholder {
  margin-top: 8px;
  padding: 14px 20px;
  border: 2px dashed var(--purple);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 13px;
  color: var(--text-soft);
  font-style: italic;
}

/* Gate — màn hình nhập mã chặn trước, trung tính, không gây tò mò */
.gate-overlay {
  position: fixed;
  inset: 0;
  background: #f4f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.gate-overlay.unlocked {
  display: none;
}

.gate-card {
  max-width: 320px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border-radius: 10px;
  padding: 32px 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.gate-title {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 700;
  color: #333333;
}

.gate-input {
  width: 100%;
  padding: 11px 14px;
  border-radius: 6px;
  border: 1px solid #d0d0d5;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  text-align: center;
  outline: none;
  background: #fafafa;
  color: #333;
}

.gate-input:focus {
  border-color: #999;
  background: white;
}

.gate-submit {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 6px;
  background: #4a4a52;
  color: white;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.gate-submit:hover {
  background: #33333a;
}

.gate-error {
  font-size: 13px;
  color: #b3261e;
  min-height: 18px;
  font-weight: 500;
}

.gate-card.shake {
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* Progress dots */
.progress-dots {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 10;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(74, 63, 85, 0.2);
  transition: background 0.3s, transform 0.3s;
}

.dot.active {
  background: #e0558f;
  transform: scale(1.3);
}

.dot.done {
  background: #c9b6ff;
}

/* Nút quay lại */
.btn-back {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 15;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-soft);
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: opacity 0.3s, background 0.2s;
  opacity: 0;
  pointer-events: none;
}

.btn-back.visible {
  opacity: 1;
  pointer-events: auto;
}

.btn-back:hover {
  background: white;
}

/* Confetti canvas */
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  display: none;
}

/* Mobile tweaks */
@media (max-width: 420px) {
  .title { font-size: 24px; }
  .subtitle { font-size: 15px; }
  .char-placeholder { width: 110px; height: 110px; font-size: 48px; }
  .final-buttons { flex-direction: column; width: 100%; }
  .btn-yes, .btn-no { width: 100%; }
}
