*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --pink: #ff69b4;
  --pink-light: #ffb6c1;
  --pink-pale: #fff0f5;
  --peach: #ffd1dc;
  --lavender: #f8e1f4;
  --white: #ffffff;
  --shadow: rgba(255, 105, 180, 0.35);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Quicksand', sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, #fff0f5 0%, #ffd1dc 40%, #f8e1f4 70%, #ffe4f0 100%);
  background-attachment: fixed;
  color: #c2185b;
  overflow-x: hidden;
}

/* Floating decorations */
.floating-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.flower {
  position: absolute;
  font-size: clamp(1.2rem, 3vw, 2rem);
  opacity: 0.5;
  animation: float 8s ease-in-out infinite;
}

.f1 { top: 8%; left: 5%; animation-delay: 0s; }
.f2 { top: 15%; right: 8%; animation-delay: 1s; }
.f3 { top: 45%; left: 3%; animation-delay: 2s; }
.f4 { top: 60%; right: 5%; animation-delay: 3s; }
.f5 { bottom: 20%; left: 10%; animation-delay: 1.5s; }
.f6 { bottom: 30%; right: 12%; animation-delay: 2.5s; }
.f7 { top: 30%; left: 50%; animation-delay: 0.5s; }
.f8 { bottom: 10%; right: 30%; animation-delay: 3.5s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-18px) rotate(8deg); }
}

/* Screens */
.screen {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.screen.active {
  opacity: 1;
  visibility: visible;
}

.screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

/* Lock Screen */
.lock-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border: 3px solid var(--pink-light);
  border-radius: 2rem;
  padding: clamp(2rem, 5vw, 3rem);
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px var(--shadow), 0 0 0 8px rgba(255, 182, 193, 0.2);
  animation: cardPop 0.6s ease;
}

@keyframes cardPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.lock-icon {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  animation: bounce 2s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.lock-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2rem, 6vw, 2.8rem);
  color: var(--pink);
  margin-bottom: 0.5rem;
}

.lock-subtitle {
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  color: #e91e8c;
  margin-bottom: 1.5rem;
  opacity: 0.85;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.password-input {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-family: inherit;
  border: 2px solid var(--pink-light);
  border-radius: 1rem;
  background: var(--pink-pale);
  color: #c2185b;
  text-align: center;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.password-input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 105, 180, 0.2);
}

.password-input::placeholder {
  color: #f48fb1;
}

.btn-enter {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--pink), #ff85c1);
  border: none;
  border-radius: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px var(--shadow);
}

.btn-enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow);
}

.btn-enter:active {
  transform: translateY(0);
}

.hint-message {
  margin-top: 1.25rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--pink);
  padding: 0.75rem 1rem;
  background: rgba(255, 182, 193, 0.3);
  border-radius: 0.75rem;
  animation: shake 0.5s ease;
}

.hint-message.hidden {
  display: none;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* Birthday Screen */
#birthday-screen {
  justify-content: flex-start;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.birthday-header {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeInDown 1s ease;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-30px); }
  to { opacity: 1; transform: translateY(0); }
}

.sparkle-text {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  animation: sparkle 2s ease infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.birthday-title {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  color: var(--pink);
  text-shadow: 2px 2px 8px rgba(255, 105, 180, 0.3);
  line-height: 1.1;
}

.birthday-name {
  font-family: 'Dancing Script', cursive;
  font-size: clamp(3rem, 10vw, 5.5rem);
  background: linear-gradient(135deg, #ff69b4, #ff85c1, #ffb6c1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0.25rem 0 0.75rem;
  animation: nameGlow 3s ease infinite;
}

@keyframes nameGlow {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(255, 105, 180, 0.4)); }
  50% { filter: drop-shadow(0 0 16px rgba(255, 105, 180, 0.7)); }
}

/* Love Letter */
.love-letter {
  width: 100%;
  max-width: 680px;
  margin: 0 auto 2.5rem;
  padding: 0 0.5rem;
  animation: fadeInDown 1.2s ease 0.3s backwards;
}

.love-letter-inner {
  position: relative;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border: 2px solid var(--pink-light);
  border-radius: 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.25rem) clamp(1.25rem, 4vw, 2rem);
  box-shadow: 0 10px 35px var(--shadow), inset 0 0 0 6px rgba(255, 240, 245, 0.8);
}

.love-letter-inner::before,
.love-letter-inner::after {
  content: '♥';
  position: absolute;
  font-size: 0.85rem;
  color: var(--pink-light);
  opacity: 0.7;
}

.love-letter-inner::before { top: 1rem; left: 1rem; }
.love-letter-inner::after { bottom: 1rem; right: 1rem; }

.love-letter-icon {
  text-align: center;
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.love-letter-text {
  font-family: 'Amiri', serif;
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  line-height: 1.9;
  color: #b71c5c;
  text-align: center;
}

.love-letter-text p {
  margin-bottom: 1.1rem;
}

.love-letter-text p:last-child {
  margin-bottom: 0;
}

.love-letter-sign {
  text-align: center;
  font-size: 1.5rem;
  margin-top: 1rem;
  animation: sparkle 2.5s ease infinite;
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1rem, 3vw, 1.5rem);
  max-width: 960px;
  width: 100%;
  padding: 0 0.5rem;
}

.photo-card {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  border: 4px solid var(--white);
  background: var(--pink-pale);
  box-shadow: 0 8px 25px var(--shadow);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.4s ease,
              border-color 0.3s ease;
  cursor: pointer;
  animation: photoFadeIn 0.6s ease backwards;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-card:nth-child(1)  { animation-delay: 0.1s; }
.photo-card:nth-child(2)  { animation-delay: 0.15s; }
.photo-card:nth-child(3)  { animation-delay: 0.2s; }
.photo-card:nth-child(4)  { animation-delay: 0.25s; }
.photo-card:nth-child(5)  { animation-delay: 0.3s; }
.photo-card:nth-child(6)  { animation-delay: 0.35s; }
.photo-card:nth-child(7)  { animation-delay: 0.4s; }
.photo-card:nth-child(8)  { animation-delay: 0.45s; }
.photo-card:nth-child(9)  { animation-delay: 0.5s; }
.photo-card:nth-child(10) { animation-delay: 0.55s; }
.photo-card:nth-child(11) { animation-delay: 0.6s; }
.photo-card:nth-child(12) { animation-delay: 0.65s; }
.photo-card:nth-child(13) { animation-delay: 0.7s; }

@keyframes photoFadeIn {
  from { opacity: 0; transform: scale(0.8) rotate(-3deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.photo-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 105, 180, 0) 60%, rgba(255, 182, 193, 0.3));
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.photo-card:hover {
  transform: scale(1.06) rotate(2deg);
  box-shadow: 0 16px 40px rgba(255, 105, 180, 0.45);
  border-color: var(--pink-light);
}

.photo-card:hover::before {
  opacity: 1;
}

.photo-card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  vertical-align: middle;
}

.footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 1rem;
  color: #e91e8c;
  opacity: 0.8;
}

/* Tablet */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .gallery {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .love-letter {
    margin-bottom: 2rem;
  }

  .love-letter-text {
    line-height: 2;
  }

  .lock-card {
    border-radius: 1.5rem;
    padding: 1.75rem 1.25rem;
  }

  #birthday-screen {
    padding-top: 2rem;
  }
}

/* Touch devices: subtle active state instead of hover */
@media (hover: none) {
  .photo-card:active {
    transform: scale(1.03);
    box-shadow: 0 12px 30px rgba(255, 105, 180, 0.4);
  }
}
