*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #020617;
  color: #0f172a;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 16px;
  overflow-x: hidden;
}

.background-gradient {
  position: fixed;
  top: -60px;
  left: -60px;
  right: -60px;
  bottom: -60px;
  background: radial-gradient(circle at top left, #fb7185 0, transparent 55%),
    radial-gradient(circle at bottom right, #f97316 0, transparent 55%),
    linear-gradient(135deg, #0f172a, #020617);
  opacity: 0.9;
  z-index: -2;
  animation: bgMove 18s ease-in-out infinite alternate;
}


.background-hearts {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

.background-hearts span {
  position: absolute;
  opacity: 0.12;
  font-size: 28px;
  color: #fecaca;
  animation: bgHeartFloat 18s linear infinite;
}

.background-hearts span:nth-child(1) {
  left: 8%;
  top: 70%;
  animation-delay: 0s;
}
.background-hearts span:nth-child(2) {
  left: 80%;
  top: 10%;
  animation-delay: 3s;
}
.background-hearts span:nth-child(3) {
  left: 20%;
  top: 20%;
  animation-delay: 6s;
}
.background-hearts span:nth-child(4) {
  left: 65%;
  top: 65%;
  animation-delay: 9s;
}
.background-hearts span:nth-child(5) {
  left: 45%;
  top: 40%;
  animation-delay: 12s;
}

.page {
  width: 100%;
  max-width: 520px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  width: 100%;
  background: rgba(248, 250, 252, 0.98);
  border-radius: 26px;
  padding: 28px 22px 26px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(16px);
  text-align: center;
  transform-origin: center;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.card-show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hidden {
  display: none;
}

h1 {
  font-size: 1.9rem;
  margin-bottom: 10px;
  color: #111827;
}

.title-soft {
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 0.98rem;
  color: #4b5563;
  margin-bottom: 20px;
  line-height: 1.5;
}

.footer-note {
  font-size: 0.9rem;
  color: #6b7280;
  margin-top: 14px;
}

.green-word {
  color: #0f5724;
  font-weight: 600;
  text-decoration: wavy underline;
}

.lock-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.lock-icon {
  position: relative;
  width: 120px;
  height: 120px;
  animation: lockFloat 3.6s ease-in-out infinite;
}

.lock-body {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 70px;
  background: linear-gradient(145deg, #f97373, #ec4899);
  border-radius: 18px;
  box-shadow: 0 10px 18px rgba(248, 113, 113, 0.6);
}

.lock-shackle {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 70px;
  border-radius: 35px 35px 30px 30px;
  border: 7px solid #fecaca;
  border-bottom: 10px solid transparent;
  box-shadow: 0 5px 12px rgba(248, 250, 252, 0.3);
}

.lock-heart {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.9rem;
  color: #fee2e2;
  text-shadow: 0 3px 6px rgba(127, 29, 29, 0.9);
  animation: heartbeat 1.5s ease-in-out infinite;
}

.input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: center;
}

.input-wrapper {
  position: relative;
  flex: 1;
}

#love-code {
  width: 100%;
  padding: 11px 14px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  font-size: 0.95rem;
  outline: none;
  background: #f9fafb;
  transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
    transform 0.15s ease;
}

#love-code::placeholder {
  color: #cbd5f5;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

#love-code:focus::placeholder {
  transform: translateX(4px);
  opacity: 0.7;
}

#love-code:focus {
  border-color: #ec4899;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.25);
  background: #ffffff;
  transform: translateY(-1px);
}

.input-glow {
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background: radial-gradient(circle at 0 0, #ec4899, transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.input-wrapper:focus-within .input-glow {
  opacity: 0.4;
}

button {
  border: none;
  cursor: pointer;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  background: linear-gradient(135deg, #ec4899, #f97316);
  color: white;
  box-shadow: 0 10px 18px rgba(236, 72, 153, 0.55);
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    filter 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

button .btn-emoji {
  display: inline-block;
  transform-origin: center;
  animation: btnEmojiWave 2s ease-in-out infinite;
}

button:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 14px 24px rgba(236, 72, 153, 0.6);
  filter: brightness(1.04);
}

button:active {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 7px 14px rgba(236, 72, 153, 0.45);
}

.lock-message {
  min-height: 20px;
  font-size: 0.9rem;
  margin-top: 4px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.lock-message.error {
  color: #b91c1c;
}

.lock-message.success {
  color: #16a34a;
}

.shake {
  animation: shake 0.35s ease;
}

.big-heart-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 auto 18px;
}

.big-heart {
  font-size: 3.6rem;
  line-height: 1;
  animation: heartbeat 1.5s ease-in-out infinite;
  color: #f97373;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.heart-orbit {
  position: absolute;
  font-size: 1.4rem;
  color: #fda4af;
  opacity: 0.8;
}

.heart-orbit-1 {
  top: -4px;
  left: 6px;
  animation: orbit1 5s linear infinite;
}
.heart-orbit-2 {
  bottom: 4px;
  right: 0;
  animation: orbit2 6s linear infinite;
}
.heart-orbit-3 {
  top: 40%;
  right: -8px;
  animation: orbit3 7s linear infinite;
}

.song-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.song {
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
  transform: translateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.2s ease;
  opacity: 0.98;
}

.song:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.25);
  opacity: 1;
}

#heart-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.heart {
  position: absolute;
  font-size: 18px;
  color: #fb7185;
  animation: floatUp 2.7s linear forwards;
  opacity: 0.9;
}

@media (max-width: 520px) {
  body {
    padding: 10px;
  }

  .card {
    border-radius: 22px;
    padding: 22px 16px 20px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .subtitle {
    font-size: 0.9rem;
  }

  .input-row {
    flex-direction: column;
    align-items: stretch;
  }

  button {
    width: 100%;
    justify-content: center;
  }

  .song {
    height: 80px;
  }
}

@keyframes bgMove {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  100% {
    transform: translate3d(-20px, 20px, 0) scale(1.05);
  }
}

@keyframes bgHeartFloat {
  0% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-22px) translateX(10px);
  }
  100% {
    transform: translateY(0) translateX(0);
  }
}

@keyframes lockFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.13);
  }
  40% {
    transform: scale(0.97);
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes floatUp {
  0% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) translateX(40px);
    opacity: 0;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-7px);
  }
  40%,
  80% {
    transform: translateX(7px);
  }
}

@keyframes btnEmojiWave {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  20% {
    transform: translateY(-1px) rotate(-8deg);
  }
  50% {
    transform: translateY(1px) rotate(6deg);
  }
  80% {
    transform: translateY(-1px) rotate(-4deg);
  }
}

@keyframes orbit1 {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(10px, 10px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes orbit2 {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-12px, -4px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes orbit3 {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(6px, -8px);
  }
  100% {
    transform: translate(0, 0);
  }
}
