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

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: "Outfit", sans-serif;
  background: linear-gradient(135deg, #ffccf9 0%, #f3ccff 50%, #d0e1ff 100%);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  overflow: hidden;
  position: relative;
}

.password-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #ffccf9 0%, #f3ccff 50%, #d0e1ff 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.password-content {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 30px;
  box-shadow: 0 20px 50px rgba(255, 105, 180, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 320px;
  width: 92%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  gap: 8px;
  max-height: 95vh;
  overflow-y: auto;
}

.pass-right-side {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pass-gif {
  width: 140px;
  height: auto;
  border-radius: 15px;
  margin-bottom: 10px;
  transition: width 0.3s ease;
}

@media (min-width: 768px) {
  .password-content {
    flex-direction: row;
    max-width: 700px;
    padding: 40px;
    gap: 40px;
    max-height: none;
  }

  .pass-gif {
    width: 280px;
    margin-bottom: 0;
  }

  .pass-right-side {
    flex: 1;
  }
}

.pass-label {
  color: #ff47a1;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(255, 105, 180, 0.1);
}

.pass-input-wrapper {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.dot {
  width: 14px;
  height: 14px;
  border: 2.5px solid #ff47a1;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.dot.active {
  background: #ff47a1;
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(255, 71, 161, 0.5);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.key {
  background: white;
  border: none;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 700;
  color: #ff47a1;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

@media (min-width: 768px) {
  .key {
    width: 65px;
    height: 65px;
    font-size: 1.8rem;
  }
}

.key:active {
  transform: scale(0.9);
  background: #fff0f7;
}

.key.delete {
  font-size: 1.4rem;
  background: #fff0f7;
}

.key.empty {
  background: transparent;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.shake-content {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  20%,
  60% {
    transform: translateX(-10px);
  }

  40%,
  80% {
    transform: translateX(10px);
  }
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.cake-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cake-img {
  width: 500px;
  max-width: 90vw;
  height: auto;
  filter: drop-shadow(0 15px 25px rgba(255, 105, 180, 0.4));
  transition: width 0.3s ease;
}

@media (min-width: 768px) {
  .cake-img {
    width: 600px;
  }
}

.candle-img {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 8vw;
  max-width: 40px;
  min-width: 25px;
  z-index: 2;
  filter: drop-shadow(0 5px 10px rgba(255, 165, 0, 0.5));
  transition:
    opacity 0.5s ease,
    transform 0.5s ease-out,
    top 0.3s ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 480px) {
  .candle-img {
    top: 12%;
  }
}

.candle-appearing {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  animation: dropInCandle 0.8s ease-out forwards;
}

@keyframes dropInCandle {
  0% {
    transform: translate(-50%, -150px);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes sway {
  from {
    transform: rotate(-3deg) translateY(0);
  }

  to {
    transform: rotate(3deg) translateY(-5px);
  }
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
}

.instruction {
  color: #ff47a1;
  font-size: 1.2rem;
  font-weight: 400;
  transition: all 0.3s ease;
}

.bounce-up {
  animation: bounceUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bounceUp {
  0% {
    transform: translateY(50px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  50% {
    transform: scale(1.05);
    opacity: 1;
  }

  100% {
    transform: scale(1);
    opacity: 0.8;
  }
}

.cake-container {
  cursor: pointer;
  transition: transform 0.3s ease;
  animation: popIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.celebration-item {
  position: absolute;
  bottom: -150px;
  pointer-events: none;
  z-index: 1;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.1));
  animation: floatUpNoRotate 8s linear forwards;
}

.floating-emoji {
  position: absolute;
  bottom: -50px;
  font-size: 2.5rem;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.1));
  animation: floatUpNoRotate 6s ease-in forwards;
}

@keyframes floatUpNoRotate {
  0% {
    transform: translateY(0);
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  75% {
    opacity: 1;
  }

  100% {
    transform: translateY(-125vh);
    opacity: 0;
  }
}

@keyframes popIn {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.letter-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 150vh);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  z-index: 100;
  transition: transform 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.letter-container.show {
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.letter-img {
  width: 150px;
  height: auto;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.3));
  animation: floatingLetterCenter 3s ease-in-out infinite;
  animation-play-state: paused;
}

.letter-container.show .letter-img {
  animation-play-state: running;
}

.letter-text {
  color: #ff47a1;
  font-weight: 700;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.8);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
  background-color: aliceblue;
  border-radius: 10px;
  border: 2px solid #ff47a1;
  padding: 5px;
}

.letter-container.show-text .letter-text {
  opacity: 1;
  transform: translateY(0);
  animation: blinkText 1.5s ease-in-out infinite;
}

@keyframes floatingLetterCenter {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-15px);
  }
}

@keyframes blinkText {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

.message-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s ease;
}

.message-modal.show {
  opacity: 1;
  visibility: visible;
}

.letter-paper {
  background: #fdf5e6;
  width: 90%;
  max-width: 500px;
  padding: 25px;
  border-radius: 5px;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  border: 6px double #d4a373;
  transform: scale(0.8);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  font-family: "Outfit", sans-serif;
  color: #5d4037;
  line-height: 1.5;
  font-size: 0.95rem;
}

@media (min-width: 768px) {
  .letter-paper {
    width: 80%;
    padding: 40px;
    border: 8px double #d4a373;
    font-size: 1rem;
    line-height: 1.6;
  }
}

.message-modal.show .letter-paper {
  transform: scale(1);
}

.letter-paper h2 {
  text-align: center;
  color: #ff47a1;
  margin-bottom: 20px;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #8d6e63;
}

.fireworks-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.rocket {
  position: absolute;
  bottom: 0;
  width: 4px;
  height: 20px;
  background: linear-gradient(to top, transparent, #fff);
  border-radius: 50% 50% 0 0;
  filter: blur(0.5px);
  animation: launch 1s ease-out forwards;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  animation: particle-explode 1.2s ease-out forwards;
}

@keyframes launch {
  0% {
    transform: translateY(0);
    opacity: 1;
  }

  100% {
    transform: translateY(calc(-1 * var(--target-height)));
    opacity: 0;
  }
}

@keyframes particle-explode {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(var(--dx), var(--dy)) scale(0);
    opacity: 0;
  }
}
