:root {
  --bg-0: #ffe6ef;
  --bg-1: #ffd0e0;
  --bg-2: #f7b6ce;
  --paper: #fff8fb;
  --paper-soft: #ffe9f1;
  --ink: #5a3344;
  --ink-soft: #9a6b7d;
  --accent: #f278a9;
  --accent-deep: #e45c93;
  --warm: #ffb4c9;
  --shadow: 0 16px 40px rgba(228, 92, 147, 0.22);
  --radius: 24px;
  --font-display: "STKaiti", "KaiTi", "PingFang SC", "Microsoft YaHei", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-0);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 60% at 15% 10%, rgba(255, 255, 255, 0.75), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(255, 182, 212, 0.65), transparent 50%),
    radial-gradient(ellipse 80% 55% at 50% 100%, rgba(244, 140, 180, 0.45), transparent 55%),
    linear-gradient(165deg, #fff0f6 0%, #ffd6e7 42%, #f5b4cc 100%);
}

.sticker-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.buddy-sticker {
  position: absolute;
  width: var(--size, 72px);
  height: auto;
  user-select: none;
  filter: drop-shadow(0 6px 10px rgba(228, 92, 147, 0.18));
  animation: buddy-float var(--duration, 5s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
  opacity: 0.92;
}

@keyframes buddy-float {
  from {
    transform: translateY(0) rotate(var(--rot, 0deg));
  }
  to {
    transform: translateY(-10px) rotate(calc(var(--rot, 0deg) + 4deg));
  }
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 18px 32px;
}

.scene {
  width: min(100%, 380px);
  display: none;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
}

.scene.is-active {
  display: block;
  animation: scene-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes scene-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card {
  position: relative;
  background: linear-gradient(180deg, var(--paper), var(--paper-soft));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 28px 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.card-shine {
  position: absolute;
  inset: -40% auto auto -20%;
  width: 70%;
  height: 70%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.7), transparent 60%);
  transform: rotate(18deg);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-align: center;
}

.cover-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 12vw, 52px);
  font-weight: 400;
  text-align: center;
  line-height: 1.2;
  color: var(--ink);
}

.cover-sub {
  margin: 14px 0 32px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, #ff8fbc, var(--accent-deep));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(228, 92, 147, 0.32);
}

.btn-primary:hover {
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
  border: 1px solid rgba(228, 92, 147, 0.18);
}

.cipher-label {
  margin: 0 0 18px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 14px;
}

.cipher-prompt {
  margin: 0 0 12px;
  text-align: center;
  font-size: 20px;
  line-height: 1.7;
  font-weight: 500;
}

.cipher-blank {
  display: inline-flex;
  vertical-align: baseline;
  margin: 0 4px;
  border-bottom: 2px solid var(--accent);
  min-width: 64px;
  justify-content: center;
}

.cipher-blank input {
  width: 64px;
  border: 0;
  background: transparent;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-deep);
  outline: none;
  padding: 0 2px 2px;
}

.cipher-hint {
  min-height: 22px;
  margin: 0 0 18px;
  text-align: center;
  font-size: 13px;
  color: #c45d7a;
}

.cipher-hint.is-ok {
  color: var(--accent-deep);
}

.card-cipher.is-shake {
  animation: shake 0.42s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
}

.photo-frame {
  overflow: hidden;
  border-radius: 16px;
  background: #ffd9e6;
  aspect-ratio: 4 / 5;
  box-shadow: inset 0 0 0 1px rgba(228, 92, 147, 0.1);
}

.photo-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.photo-slide {
  flex: 0 0 100%;
  height: 100%;
}

.photo-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-caption {
  margin: 16px 0 12px;
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  min-height: 48px;
}

.photo-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 16px;
}

.photo-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(228, 92, 147, 0.22);
  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.photo-dots span.is-active {
  background: var(--accent);
  transform: scale(1.25);
}

.photo-nav {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

.ask-question {
  margin: 8px 0 36px;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(28px, 8vw, 34px);
  line-height: 1.35;
}

.ask-actions {
  position: relative;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.btn-agree {
  background: linear-gradient(135deg, #ff8fbc, var(--accent-deep));
  color: #fff;
  font-weight: 700;
  min-width: 132px;
  box-shadow: 0 10px 24px rgba(228, 92, 147, 0.3);
  z-index: 2;
  transition:
    transform 0.25s ease,
    font-size 0.25s ease,
    min-width 0.25s ease,
    padding 0.25s ease;
}

.btn-disagree {
  position: relative;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  font-weight: 500;
  min-width: 120px;
  z-index: 1;
  border: 1px solid rgba(228, 92, 147, 0.14);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease,
    font-size 0.2s ease,
    padding 0.2s ease,
    min-width 0.2s ease;
}

.card-success {
  text-align: center;
  padding-top: 40px;
  padding-bottom: 44px;
}

.success-face {
  width: 110px;
  height: auto;
  margin: 0 auto 14px;
  display: block;
  animation: pop 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  filter: drop-shadow(0 8px 14px rgba(228, 92, 147, 0.2));
}

.success-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 36px;
}

.success-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

@keyframes pop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  70% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

@media (max-width: 360px) {
  .card {
    padding: 28px 20px 22px;
  }

  .cipher-prompt {
    font-size: 18px;
  }
}
