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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0f172a;
  color: #e5e7eb;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 5.5rem;
}

.app {
  width: 100%;
  max-width: 960px;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  margin-bottom: 1.5rem;
  color: #9ca3af;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.card {
  background: #111827;
  border-radius: 0.75rem;
  border: 1px solid #1f2937;
  padding: 1.1rem;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease;
  color: #f9fafb; /* Ensure card text is light on dark background */
}

.card--selected {
  background: #1d4ed8;
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.75);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  border-color: #3b82f6;
}

.card-title {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.card-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.btn {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: background-color 0.08s ease, transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-yes {
  background: #16a34a;
  color: #ecfdf5;
}

.btn-yes:hover {
  background: #22c55e;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.35);
  transform: translateY(-1px);
}

.btn-no {
  background: #b91c1c;
  color: #fee2e2;
}

.btn-no:hover {
  background: #dc2626;
  box-shadow: 0 8px 20px rgba(248, 113, 113, 0.35);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.badge {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #9ca3af;
}

.controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #020617;
  border-top: 1px solid #1f2937;
  padding: 0.85rem 1.5rem 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}

.controls-label {
  font-size: 0.9rem;
  color: #e5e7eb;
  text-align: center;
}

.controls-actions {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  max-width: 360px;
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
}

.confetti-piece {
  position: absolute;
  width: 6px;
  height: 14px;
  top: -10%;
  border-radius: 999px;
  opacity: 0.9;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  animation-fill-mode: forwards;
}

.yippee-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 45; /* under confetti (50), above content */
  opacity: 0;
  animation: yippee-fade 1.8s ease-out forwards;
}

.yippee-image {
  max-width: min(380px, 90vw);
  height: auto;
}

@keyframes yippee-fade {
  0% {
    opacity: 0;
    transform: scale(0.95);
  }
  20% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.02);
  }
}

.pleading-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 60;
  opacity: 0;
  animation: pleading-fade 3.5s ease-out forwards;
}

.pleading-image {
  max-width: min(360px, 90vw);
  height: auto;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.6));
}

@keyframes pleading-fade {
  0% {
    opacity: 0;
    transform: scale(0.9);
  }
  30% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.05);
  }
}

@keyframes confetti-fall {
  0% {
    transform: translate3d(0, -100%, 0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate3d(0, 120vh, 0) rotate(360deg);
    opacity: 0;
  }
}

@media (max-width: 600px) {
  body {
    padding: 1rem 1rem 5.5rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
  }

  .card {
    padding: 1.2rem;
    min-height: 140px;
  }

  .card-title {
    font-size: 1rem;
  }

  .btn {
    padding: 0.7rem 1.6rem;
    font-size: 1.1rem;
  }
}
