@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600;700&family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400&display=swap&subset=vietnamese');

:root {
  --text: #fff;
  --text-soft: rgba(255, 255, 255, 0.82);
  --accent: #ff5a7a;
  --glass: rgba(255, 255, 255, 0.14);
  --glass-border: rgba(255, 255, 255, 0.35);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', sans-serif;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
  background-color: #3a1c2e;
  overflow-x: hidden;
}

/* Background: one fixed layer, never tiled */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background: url('img/background.jpg') center / cover no-repeat;
}

/* Soft dark gradient so white text is always readable */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at center, rgba(40, 10, 30, 0.15) 0%, rgba(40, 10, 30, 0.55) 100%),
    linear-gradient(to bottom, rgba(20, 5, 20, 0.35), rgba(20, 5, 20, 0.15) 40%, rgba(20, 5, 20, 0.45));
}

.title {
  margin: 0;
  font-family: 'Dancing Script', cursive;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: 0.5px;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.box {
  width: min(640px, 100%);
  padding: 2rem 2rem 1.5rem;
  border-radius: 28px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  text-align: center;
  animation: fade-up 0.9s ease both;
}

/* Couple row */
.about {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.avatar {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.details p {
  margin: 0;
}

.name {
  font-size: 1.25rem;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.born {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-top: 2px !important;
}

.heart-box {
  display: flex;
  justify-content: center;
}

.heart {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 4px 10px rgba(255, 60, 100, 0.55));
  animation: heartbeat 1.4s ease-in-out infinite;
}

/* Counter */
.content {
  padding: 1.25rem 0 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.days {
  margin: 0;
  font-size: clamp(2.8rem, 9vw, 4.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 1px;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
}

.days small {
  font-size: 0.4em;
  font-weight: 400;
  letter-spacing: 3px;
  margin-left: 0.3rem;
}

.sup-time {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1rem 0 0;
}

.sup-time .unit {
  min-width: 68px;
  padding: 0.5rem 0.4rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.sup-time .unit span {
  display: block;
  font-size: 1.4rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.sup-time .unit label {
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-soft);
}

.since {
  margin: 1rem 0 0;
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 300;
  color: var(--text-soft);
}

.say-thank {
  margin: 1.25rem 0 0;
  font-family: 'Dancing Script', cursive;
  font-size: 1.9rem;
  font-weight: 700;
  color: #ffd1dc;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Music toggle */
.music-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.music-btn:hover {
  transform: scale(1.08);
}

.music-btn.playing {
  animation: spin 4s linear infinite;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.18); }
  30% { transform: scale(1); }
  45% { transform: scale(1.12); }
  60% { transform: scale(1); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .heart, .box, .music-btn.playing { animation: none; }
}

/* Mobile */
@media (max-width: 520px) {
  body {
    gap: 1rem;
    padding: 1.5rem 16px 5rem;
  }

  .box {
    padding: 1.5rem 1rem 1.25rem;
    border-radius: 22px;
  }

  .about {
    gap: 0.5rem;
    margin-bottom: 1.25rem;
  }

  .avatar {
    width: 74px;
    height: 74px;
  }

  .name {
    font-size: 1.1rem;
  }

  .heart {
    width: 46px;
    height: 46px;
  }

  .sup-time {
    gap: 0.5rem;
  }

  .sup-time .unit {
    min-width: 0;
    flex: 1;
  }

  .sup-time .unit span {
    font-size: 1.2rem;
  }

  .say-thank {
    font-size: 1.6rem;
  }
}
