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

:root {
  --pink: #FF8FAB;
  --pink-light: #FFE4EC;
  --pink-dark: #E85A7A;
  --cream: #FFF9F0;
  --yellow: #FFE566;
  --text: #4A3040;
  --shadow: rgba(232, 90, 122, 0.25);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Gaegu', cursive;
  background: var(--cream);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

/* ── Lock Screen ── */
.lock-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem 1.5rem;
  background: linear-gradient(160deg, #FFE4EC 0%, #FFF0F5 40%, #FFF9F0 100%);
  position: relative;
  overflow: hidden;
}

.lock-screen::before {
  content: '🔒';
  position: absolute;
  font-size: 8rem;
  opacity: 0.06;
  top: 10%;
  right: -5%;
  animation: float 4s ease-in-out infinite;
}

.lock-screen::after {
  content: '💕';
  position: absolute;
  font-size: 6rem;
  opacity: 0.06;
  bottom: 15%;
  left: -3%;
  animation: float 5s ease-in-out infinite reverse;
}

.lock-card {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 28px;
  padding: 2.5rem 2rem;
  box-shadow: 0 8px 32px var(--shadow);
  border: 2px solid rgba(255, 143, 171, 0.3);
  text-align: center;
  position: relative;
  z-index: 1;
}

.lock-emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
  animation: wiggle 2s ease-in-out infinite;
}

.lock-title {
  font-family: 'Jua', sans-serif;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--pink-dark);
  margin-bottom: 1.5rem;
}

.lock-input-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.lock-input {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border: 2.5px dashed var(--pink);
  border-radius: 16px;
  font-family: 'Gaegu', cursive;
  font-size: 1.2rem;
  text-align: center;
  background: var(--cream);
  color: var(--text);
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.lock-input:focus {
  border-color: var(--pink-dark);
  box-shadow: 0 0 0 4px rgba(255, 143, 171, 0.2);
}

.lock-input::placeholder {
  color: #CCA0B0;
  font-size: 1rem;
}

.lock-btn {
  width: 100%;
  padding: 0.9rem;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  color: white;
  font-family: 'Jua', sans-serif;
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 16px var(--shadow);
}

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

.lock-error {
  margin-top: 0.8rem;
  color: var(--pink-dark);
  font-size: 1rem;
  min-height: 1.5rem;
  animation: shake 0.5s ease;
}

.lock-hint {
  margin-top: 1.2rem;
  font-size: 0.9rem;
  color: #B08090;
}

/* ── Slideshow ── */
.slideshow {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1.2rem 5rem;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.45s ease;
  pointer-events: none;
  background: linear-gradient(160deg, #FFE4EC 0%, #FFF9F0 100%);
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 2;
}

.slide.exit-left {
  transform: translateX(-100%);
  opacity: 0;
  z-index: 1;
}

.slide.exit-right {
  transform: translateX(100%);
  opacity: 0;
  z-index: 1;
}

/* Title slide */
.slide-title {
  text-align: center;
}

.slide-title .big-emoji {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: bounce 1.5s ease infinite;
}

.slide-title h1 {
  font-family: 'Jua', sans-serif;
  font-size: 2.4rem;
  color: var(--pink-dark);
  line-height: 1.3;
  white-space: pre-line;
  margin-bottom: 0.8rem;
}

.slide-title .subtitle {
  font-size: 1.3rem;
  color: #9A6070;
}

/* Photo slide */
.slide-photo {
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 52vh;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 28px var(--shadow);
  border: 3px solid white;
  margin: 0 auto 1.2rem;
  background: var(--pink-light);
}

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

.photo-caption {
  font-family: 'Jua', sans-serif;
  font-size: 1.1rem;
  color: var(--pink-dark);
  margin-bottom: 0.5rem;
}

.photo-message {
  font-size: 1.25rem;
  line-height: 1.6;
  white-space: pre-line;
  color: var(--text);
}

/* Final slide */
.slide-final {
  text-align: center;
  padding: 2rem;
}

.slide-final h2 {
  font-family: 'Jua', sans-serif;
  font-size: 2rem;
  color: var(--pink-dark);
  margin-bottom: 1.5rem;
}

.slide-final .final-message {
  font-size: 1.3rem;
  line-height: 1.8;
  white-space: pre-line;
  color: var(--text);
}

.final-hearts {
  font-size: 2.5rem;
  margin-top: 1.5rem;
  animation: pulse 1.5s ease infinite;
}

/* Navigation */
.nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem calc(1rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 143, 171, 0.2);
  z-index: 100;
}

.nav-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--pink-light);
  color: var(--pink-dark);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}

.nav-btn:active {
  transform: scale(0.9);
}

.nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.nav-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.nav-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #F0C0D0;
  transition: all 0.3s;
}

.nav-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--pink);
}

/* Floating decorations */
.float-deco {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  animation: float 3s ease-in-out infinite;
  opacity: 0.5;
}

/* Confetti */
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  z-index: 200;
  animation: confetti-fall linear forwards;
  pointer-events: none;
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-12px) rotate(5deg); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* Tablet / Desktop */
@media (min-width: 480px) {
  .slide-title h1 { font-size: 2.8rem; }
  .photo-frame { max-height: 55vh; }
  .lock-card { padding: 3rem 2.5rem; }
}
