:root {
  --yellow: #FFC933;
  --yellow-deep: #F5A623;
  --blue: #2D5DE0;
  --blue-deep: #17348C;
  --ink: #1A1A2E;
  --paper: #FFFDF7;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--paper);
  position: fixed;
  inset: 0;
}

.eyebrow,
.slide-hero h1,
.slide h2,
.pix-amount,
.copy-btn,
.stack-caption,
.message-emoji {
  font-family: 'Fredoka', 'Segoe UI', sans-serif;
}

.slides {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
}

.slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  text-align: center;
  transition: transform 0.6s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

.slide-hero {
  background: radial-gradient(circle at 30% 20%, var(--blue) 0%, var(--blue-deep) 55%, var(--ink) 100%);
}

.slide-art {
  background: linear-gradient(160deg, var(--blue-deep), var(--ink));
}

.slide-album {
  background: linear-gradient(160deg, #1c2b63, var(--ink));
}

.slide-message {
  background: radial-gradient(circle at 70% 30%, var(--yellow-deep) 0%, var(--blue-deep) 60%, var(--ink) 100%);
}

.slide-gift {
  background: linear-gradient(160deg, var(--blue-deep), #0d1a4d);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 13px;
  color: var(--yellow);
  font-weight: 700;
  margin: 0;
}

.slide-hero h1 {
  font-size: clamp(32px, 9vw, 56px);
  margin: 0;
  line-height: 1.1;
}

.highlight {
  color: var(--yellow);
}

.subtitle {
  font-size: clamp(16px, 4vw, 19px);
  margin: 4px 0 0;
  opacity: 0.92;
}

.confetti-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.confetti-piece {
  position: absolute;
  bottom: -20px;
  opacity: 0;
  animation-name: floatUp;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes floatUp {
  0% { transform: translateY(0) rotate(0deg); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateY(-92vh) rotate(360deg); opacity: 0; }
}

.slide-hero > *:not(.confetti-layer) {
  position: relative;
  z-index: 1;
}

.swipe-hint {
  position: absolute;
  bottom: 36px;
  font-size: 13px;
  letter-spacing: 1px;
  opacity: 0.75;
  animation: bob 1.8s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-6px); opacity: 0.9; }
}

.slide h2 {
  font-size: clamp(20px, 5.5vw, 26px);
  margin: 0;
  color: var(--paper);
}

.art-frame {
  position: relative;
  width: min(80vw, 340px);
  height: min(52vh, 420px);
  border-radius: 18px;
  overflow: hidden;
  border: 4px solid var(--yellow);
  background: linear-gradient(135deg, #2a3b7a, #17348C);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 34px rgba(0,0,0,0.35);
  opacity: 0;
  transform: scale(0.8) rotate(-4deg);
}

.slide-art.active .art-frame {
  animation: artReveal 0.9s cubic-bezier(.2,.8,.25,1) forwards;
}

@keyframes artReveal {
  0% { opacity: 0; transform: scale(0.8) rotate(-4deg); }
  65% { opacity: 1; transform: scale(1.05) rotate(1deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.art-caption {
  margin: 0;
  font-size: 14px;
  opacity: 0;
  font-weight: 600;
}

.slide-art.active .art-caption {
  animation: fadeInUp 0.7s ease 0.5s forwards;
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.sparkle {
  position: absolute;
  font-size: 22px;
  opacity: 0;
  z-index: 2;
}

.slide-art.active .sparkle {
  animation: twinkle 1.8s ease-in-out infinite;
}

.sparkle-a { top: 8px; left: 10px; animation-delay: 0.6s !important; }
.sparkle-b { bottom: 10px; right: 12px; animation-delay: 1.1s !important; }

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.6) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(15deg); }
}

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

.art-placeholder {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--paper);
  font-weight: 600;
}

.art-placeholder-emoji {
  font-size: 44px;
}

.album-hint {
  margin: -6px 0 0;
  font-size: 13px;
  opacity: 0.8;
  font-weight: 600;
}

.stack-wrap {
  display: flex;
  justify-content: center;
}

.photo-stack {
  position: relative;
  width: min(64vw, 250px);
  height: min(40vh, 310px);
  touch-action: none;
}

.photo-card {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 4px solid var(--yellow);
  background: #DCE1F0;
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
  cursor: grab;
  will-change: transform;
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1), box-shadow 0.35s;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.photo-card.dragging {
  transition: none;
  cursor: grabbing;
  box-shadow: 0 18px 34px rgba(0,0,0,0.4);
}

.photo-card.flying {
  transition: transform 0.45s ease-in, opacity 0.45s ease-in;
}

.stack-caption {
  max-width: 300px;
  margin: 0;
  font-size: clamp(13px, 3.6vw, 15px);
  font-style: italic;
  font-weight: 600;
  color: var(--yellow);
  min-height: 38px;
  transition: opacity 0.25s ease;
}

.stack-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.stack-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: background 0.25s, transform 0.25s;
}

.stack-dot.active {
  background: var(--yellow);
  transform: scale(1.3);
}

.message-emoji {
  font-size: 40px;
}

.message-text {
  max-width: 480px;
  font-size: clamp(16px, 4.2vw, 20px);
  line-height: 1.65;
  margin: 0;
}

.gift-text {
  margin: 0;
  font-size: 15px;
  opacity: 0.9;
}

.pix-amount {
  display: inline-block;
  background: var(--yellow);
  color: var(--blue-deep);
  font-weight: 800;
  font-size: clamp(18px, 5vw, 22px);
  padding: 8px 22px;
  border-radius: 999px;
}

.qrcode-box {
  position: relative;
  display: flex;
  justify-content: center;
}

.qrcode-box::before {
  content: '';
  position: absolute;
  inset: -16px;
  border-radius: 22px;
  background: radial-gradient(circle, rgba(255,201,51,0.55), transparent 70%);
  animation: pulseGlow 2.2s ease-in-out infinite;
  z-index: 0;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.18); opacity: 1; }
}

.qrcode-box canvas {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  border: 4px solid var(--yellow);
  width: min(46vw, 170px) !important;
  height: min(46vw, 170px) !important;
}

.gift-direct {
  margin: -4px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--yellow);
}

.gift-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(80vw, 300px);
}

.copy-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}

.copy-btn.primary {
  background: var(--yellow);
  color: var(--blue-deep);
}

.copy-btn.ghost {
  background: rgba(255,255,255,0.12);
  color: var(--paper);
  border: 2px solid rgba(255,255,255,0.35);
}

.gift-note {
  font-size: 13px;
  opacity: 0.85;
  margin: 0;
}

.gift-thanks {
  font-size: 13px;
  opacity: 0.7;
  margin: 6px 0 0;
}

.page-dots {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
}

.page-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: background 0.25s, transform 0.25s;
  border: none;
  padding: 0;
}

.page-dot.active {
  background: var(--yellow);
  transform: scale(1.4);
}

.nav-arrow {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.14);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: opacity 0.3s, transform 0.2s;
}

.nav-arrow svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.nav-arrow:active {
  transform: translateX(-50%) scale(0.9);
}

.nav-up {
  top: 16px;
}

.nav-down {
  bottom: 16px;
}

.nav-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

.nav-arrow.locked {
  opacity: 0.35;
  animation: shakeLocked 1.6s ease-in-out infinite;
}

@keyframes shakeLocked {
  0%, 100% { transform: translateX(-50%); }
  50% { transform: translateX(-50%) translateY(4px); }
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 30;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-height: 720px) and (min-width: 700px) {
  .art-frame { width: min(50vw, 380px); height: min(56vh, 440px); }
  .photo-stack { width: min(30vw, 280px); height: min(44vh, 340px); }
}
