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

body {
  font-family: Arial, sans-serif;
  text-align: center;
  padding: 20px;
  background-color: #f8c8dc;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  background-color: rgba(255, 255, 255, 0.9);
  padding: 2rem;
  border-radius: 15px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 90%;
  max-width: 500px;
}

h1 {
  color: #350fdd;
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

label {
  font-size: 1.1rem;
  color: #333;
}

input,
button {
  padding: 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: 2px solid #ddd;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

button {
  background-color: #350fdd;
  color: white;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #2a0cb1;
}

input:focus-visible,
button:focus-visible {
  outline: 3px solid #350fdd;
  outline-offset: 2px;
}

/* ---------- Mensagem principal (#result) ---------- */

#result {
  font-size: 1.2rem;
  font-weight: bold;
  color: #350fdd;
  min-height: 1.5em;
}

#result.is-waiting {
  font-weight: normal;
  color: #8a8a9e;
}

#result.is-error {
  color: #c2185b;
}

/* ---------- Bloco revelado (#resultReveal) ---------- */

.reveal {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.reveal.fade-in {
  opacity: 1;
}

/* ---------- Contador de dias (#counter + .flap) ---------- */

.counter {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  perspective: 400px;
}

.flap {
  display: grid;
  place-items: center;
  min-width: 2.6rem;
  padding: 0.6rem 0.4rem;
  background-color: #350fdd;
  color: #fff;
  border-radius: 8px;
  font-size: 2rem;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}

.flap.is-flipping {
  transform-origin: top center;
  animation: flip 0.45s ease both;
}

@keyframes flip {
  from {
    transform: rotateX(-90deg);
    opacity: 0;
  }
  to {
    transform: rotateX(0);
    opacity: 1;
  }
}

.counter-label {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #666;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------- Coração (#heart) ---------- */

.heart {
  margin: 1rem 0;
  font-size: 2rem;
  color: #e0447c;
}

.heart.is-beating {
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.1);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.1);
  }
  70% {
    transform: scale(1);
  }
}

/* ---------- Estatísticas ---------- */

.stats {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.stat {
  flex: 1 1 140px;
  padding: 0.75rem;
  border-radius: 10px;
  background-color: rgba(53, 15, 221, 0.06);
}

.stat dt {
  font-size: 0.8rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat dd {
  margin-top: 0.25rem;
  font-size: 1.1rem;
  font-weight: bold;
  color: #350fdd;
  font-variant-numeric: tabular-nums;
}

/* ---------- Responsividade ---------- */

@media (max-width: 768px) {
  .container {
    width: 95%;
    padding: 1.5rem;
  }
  h1 {
    font-size: 1.5rem;
  }
  input,
  button {
    font-size: 0.9rem;
    padding: 10px;
  }
  #result {
    font-size: 1rem;
  }
  .flap {
    min-width: 2.2rem;
    font-size: 1.6rem;
  }
}

@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  .container {
    padding: 1rem;
  }
  h1 {
    font-size: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
