:root {
  --bg: #fbf5f5;
  --surface: #fffafa;
  --text: #2e1f24;
  --muted: #7f5f68;
  --rose-100: #f4d8de;
  --rose-200: #e8c2cc;
  --rose-400: #b66579;
  --rose-600: #8a3c52;
  --good: #2f7d4a;
  --bad: #9c2f3f;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow: 0 20px 45px rgba(113, 46, 66, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(182, 101, 121, 0.11), transparent 42%),
    radial-gradient(circle at 95% 15%, rgba(220, 181, 191, 0.18), transparent 40%),
    linear-gradient(180deg, #fffdfd, var(--bg));
  overflow-x: hidden;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  position: relative;
  z-index: 1;
}

.card-wrap {
  width: min(760px, 100%);
}

.hidden {
  display: none !important;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-header {
  margin-bottom: 0.9rem;
}

.site-footer {
  margin-top: 0.9rem;
}

.brand {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: 0.01em;
}

.card {
  background: linear-gradient(180deg, var(--surface), #fff7f9);
  border: 1px solid rgba(182, 101, 121, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1.2rem, 3vw, 2.2rem);
  min-height: 400px;
  display: grid;
  align-content: center;
}

.card.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.card.is-entering {
  opacity: 0;
  transform: translateY(8px);
  animation: cardIn 240ms ease forwards;
}

@keyframes cardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.step-block {
  display: grid;
  gap: 1rem;
}

.question-title {
  margin: 0;
  line-height: 1.25;
  font-size: clamp(1.22rem, 3vw, 1.9rem);
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.answer-grid {
  display: grid;
  gap: 0.7rem;
}

.answer-btn {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--rose-200);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text);
  text-align: left;
  font: inherit;
  padding: 0.82rem 0.95rem;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 170ms ease, background-color 140ms ease;
}

.answer-btn:hover {
  transform: translateY(-1px);
  border-color: var(--rose-400);
}

.answer-btn:disabled {
  cursor: default;
}

.answer-btn.is-selected {
  border-color: var(--rose-400);
  box-shadow: 0 0 0 2px rgba(182, 101, 121, 0.18);
}

.answer-btn.answer-correct {
  border-color: rgba(47, 125, 74, 0.5);
  box-shadow: 0 0 0 2px rgba(47, 125, 74, 0.2), 0 0 26px rgba(47, 125, 74, 0.16);
  background: rgba(47, 125, 74, 0.07);
}

.answer-btn.answer-wrong {
  border-color: rgba(156, 47, 63, 0.5);
  box-shadow: 0 0 0 2px rgba(156, 47, 63, 0.16), 0 0 24px rgba(156, 47, 63, 0.13);
  background: rgba(156, 47, 63, 0.07);
}

.feedback {
  margin: 0;
  min-height: 1.2em;
  font-weight: 600;
}

.feedback.good {
  color: var(--good);
}

.feedback.bad {
  color: var(--bad);
}

.heart-progress {
  display: inline-flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.heart-dot {
  font-size: 1rem;
  color: rgba(182, 101, 121, 0.3);
  transition: transform 180ms ease, color 180ms ease;
}

.heart-dot.filled {
  color: #b24e68;
  transform: scale(1.08);
}

.btn {
  min-height: 46px;
  padding: 0.7rem 1.05rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  transform: none;
  opacity: 0.75;
  cursor: default;
}

.btn-primary {
  color: #fff;
  background: var(--rose-600);
}

.btn-primary:hover {
  background: #783349;
}

.btn-ghost {
  color: var(--text);
  border-color: var(--rose-200);
  background: rgba(255, 255, 255, 0.86);
}

.input-form {
  display: grid;
  gap: 0.85rem;
  max-width: 440px;
}

.text-input {
  width: 100%;
  border: 1px solid var(--rose-200);
  border-radius: var(--radius-md);
  padding: 0.9rem 0.95rem;
  font: inherit;
}

.text-input:focus-visible,
.answer-btn:focus-visible,
.btn:focus-visible,
.love-slider:focus-visible {
  outline: 3px solid rgba(138, 60, 82, 0.65);
  outline-offset: 2px;
}

.slider-wrap {
  display: grid;
  gap: 0.7rem;
}

.love-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(182, 101, 121, 0.2), rgba(138, 60, 82, 0.45));
  outline: none;
}

.love-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 34px;
  height: 34px;
  border: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Ctext x='50%25' y='50%25' dominant-baseline='middle' text-anchor='middle' font-size='26'%3E%F0%9F%90%8C%3C/text%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
}

.love-slider::-moz-range-thumb {
  width: 34px;
  height: 34px;
  border: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 44'%3E%3Ctext x='50%25' y='50%25' dominant-baseline='middle' text-anchor='middle' font-size='26'%3E%F0%9F%90%8C%3C/text%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.reveal {
  position: relative;
  animation: revealIn 440ms ease;
}

@keyframes revealIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal-title {
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.reveal-body {
  margin: 0;
  line-height: 1.75;
  font-size: clamp(1.02rem, 2.2vw, 1.2rem);
  color: #3d2830;
  white-space: pre-line;
}

.reveal-photo {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid rgba(182, 101, 121, 0.24);
  box-shadow: 0 14px 28px rgba(113, 46, 66, 0.18);
}

.reveal-accent {
  position: absolute;
  right: 0;
  top: -0.3rem;
  display: inline-flex;
  gap: 0.35rem;
  font-size: 1.15rem;
  color: rgba(138, 60, 82, 0.65);
}

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

.shape {
  position: absolute;
  opacity: 0.24;
}

.heart {
  width: 26px;
  height: 26px;
  transform: rotate(-45deg);
  background: rgba(138, 60, 82, 0.25);
  border-radius: 4px;
}

.heart::before,
.heart::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(138, 60, 82, 0.25);
}

.heart::before {
  top: -13px;
  left: 0;
}

.heart::after {
  left: 13px;
  top: 0;
}

.snail {
  width: 34px;
  height: 20px;
  border: 2px solid rgba(138, 60, 82, 0.3);
  border-radius: 14px;
}

.snail::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 1px;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(138, 60, 82, 0.3);
  border-radius: 50%;
}

.heart-a { top: 12%; left: 8%; }
.heart-b { top: 72%; right: 12%; transform: rotate(-32deg); }
.snail-a { top: 20%; right: 8%; }
.snail-b { bottom: 11%; left: 14%; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 680px) {
  .page {
    padding: 1rem;
  }

  .site-header,
  .site-footer {
    flex-wrap: wrap;
  }

  .card {
    min-height: 430px;
  }

  .heart-progress {
    width: 100%;
    justify-content: flex-start;
  }
}
