/* === General body === */
body {
  font-family: "Hanken Grotesk", sans-serif;
  margin: auto;
  padding: 0;
  text-align: center;
  background-color: #ffaed7;
  font-size: 0.8rem;
  color: #333;
  width: 100%;
}

/* === Header === */
header h1 {
  margin-bottom: 1rem;           /* slightly tighter */
}

/* === Single card === */
.card {
  flex: 1;                         /* fill the container */
  height: auto;
  max-height: none;                /* respect aspect ratio box */
  width: auto;
  max-width: none;
  background-color: #ffaed7;
  border-radius: 0;                /* match container edges */
  padding: 0.1em;                  /* tighter padding to fit */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.9rem;               /* slightly smaller text */
  line-height: 1.3;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.card p {
  margin: 0 0 0.5em;
}

.button-row {
  display: flex;
  justify-content: center;
  flex-direction: row-reverse;  /* 👈 flips visual order */
  gap: 0.5em;
  margin-top: 0;
}

/* === Buttons inside cards === */
button {
  margin: 0;
  padding: 0.75em 1em;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
  width: 45%;
}

button:hover {
  transform: translateY(-2px);
}

/* Full-width on very small screens */
@media (width <= 480px) {
  button {
    width: 100%;
    margin: 0.5em 0;
  }
}

/* Crush + Blush */
.btn.crush {
  background-color: #28a745; /* green */
  color: #fff;
}

.btn.blush {
  background-color: #dc3545; /* red */
  color: #fff;
}

/* Submit button */
#submit-btn {
  background-color: #800080; /* blue */
  color: #fff;
  margin-top: 10px;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
}

/* === Survey wrapper enforces ratio === */
#survey-wrapper {
  width: 100%;
  max-width: 600px;         /* same as header image */
  aspect-ratio: 16 / 9;     /* lock ratio */
  background-color: #ffaed7;
  border-radius: 8px;
  margin: 0 auto 1em;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* Intro + counter fit inside wrapper */
#survey-intro {
  background: #ffaed7;
  padding: 0.5em;
  font-size: 0.9rem;
  line-height: 1.3;
  z-index: 10;
}

.survey-intro-card {
  background: #ffaed7;
  border-radius: 10px;
  padding: 1em;
  font-size: 1.0rem;
  line-height: 1.2;
  text-align: center;
  max-width: 500px;
}

.survey-intro-card h2 {
  margin-bottom: 0.5em;
  color: #ffaed7; /* accent color */
}

#survey-counter {
  background: #ffaed7;
  font-weight: bold;
  margin: 0;
  padding: 0.25em;
  font-size: 0.9rem;
  z-index: 9;
}

/* Survey container — auto-fit content, align top */
#cards-container {
  width: 100%;
  margin: 0.25em auto;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* top align */
  overflow: visible;       /* no forced scroll */
}

/* Open-end + Submit block */
.survey-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 500px;
  margin: 1em auto;
  gap: 0.75em; /* space between label, textarea, button */
}

.survey-form textarea {
  width: 100%;
  min-height: unset;
}

.survey-form button {
  align-self: flex-start; /* left align the button */
}

#survey-final {
  text-align: center;
  margin-top: 1em;
}

#survey-final img.survey-final-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Shared styling for counter + trait text */
.survey-card-block {
  background: #ffb077;   /* same orange as game cards */
  border-radius: 8px;
  padding: 1em;
  text-align: center;
}

.survey-trait-text {
  font-size: 1.3em;
  color: #000;
  font-weight: bold;
  margin: 0.5em 0.75em;
  text-align: center;
}


/* 📱 Mobile: shrink font below 480px */
@media (width <= 480px) {
  .survey-trait-text {
    font-size: 1.0em;   /* smaller on mobile */
    line-height: 1.2;   /* adjust spacing so it stays readable */
  }
}

/* Force open-end textarea to act like a single-line field */
#open-end-input {
  resize: none;
  height: 2.2em;
  line-height: 1.4em;
  overflow-y: hidden;
  white-space: nowrap;
}

#survey-final img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

/* Completion message constrained */
#thanks {
  background: #ffaed7;
  text-align: center;
  font-weight: bold;
  padding: 1em;
  font-size: 0.9rem;
  border-radius: 6px;
  margin: 0.5em;
  opacity: 0%;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* Thank-you inherits accent color */
#thanks.counter-green {
  border: 3px solid #28a745;
  color: #28a745;
}

#thanks.counter-orange {
  border: 3px solid #000;
  color: #000;
}

#thanks.counter-red {
  border: 3px solid #dc3545;
  color: #dc3545;
}

#thanks.show {
  opacity: 100%;
  transform: translateY(0);
}

/* Hide utility */
.hidden {
  display: none !important;
}

/* === Mobile tweaks === */
@media (width <= 480px) {
  button {
    display: inline-block;
    width: 100%;
    margin: 0.5em 0;
  }

  .card {
    padding: 12px;
  }
}

/* Swipe feedback + animations */
.card.swiping {
  opacity: 90%;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.card.swipe-left {
  transform: translateX(-120%) rotate(-10deg);
  opacity: 0%;
}

.card.swipe-right {
  transform: translateX(120%) rotate(10deg);
  opacity: 0%;
}

/* Fade out utility */
.fade-out {
  opacity: 0%;
  transition: opacity 0.4s ease;
}

/* Counter pop animation */
@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.pop {
  animation: pop 0.3s ease;
}

/* Counter colors */
.counter-green {
  color: #28a745; /* green */
}

.counter-orange {
  color: #000; /* orange */
}

.counter-red {
  color: #dc3545; /* red */
}

/* Button row inside card */
.card .button-row {
  display: flex;
  justify-content: center;
  gap: 1em; /* small space between buttons */
  margin-top: 1em;
}

.button-row .btn {
  flex: 1;
  padding: 0.5em 0.75em;         /* slimmer buttons */
  font-size: 0.8rem;
  max-width: 45%;
}

.card .button-row .btn {
  flex: 1;
  padding: 0.5em 0.75em;         /* slimmer buttons */
  font-size: 0.8rem;
  max-width: 45%;
}

.button.is-sugarpop {
  background: #800080;
  color: #fff;
  margin-top: 10px;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
}