:root {
  --ink: #181519;
  --paper: #fffdfb;
  --shell: #f8f6f2;
  --shell-edge: #9f9c97;
  --pink: #ee4bbb;
  --pink-soft: #ffe0f3;
  --pink-mist: #ffd4ec;
  --shadow: #2d292e;
  --muted: #6f6870;
  --focus: #7a1cff;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 197, 230, 0.58), transparent 25rem),
    radial-gradient(circle at 86% 88%, rgba(230, 255, 224, 0.64), transparent 24rem),
    linear-gradient(135deg, #ffe4f3 0%, #fffaf7 46%, #f5fff0 100%);
  font-family: "Arial Rounded MT Bold", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

.phone-shell {
  position: relative;
  width: min(94vw, 520px);
  min-height: min(92vh, 860px);
  display: grid;
  place-items: center;
  padding: clamp(28px, 6vw, 54px) clamp(18px, 4vw, 36px);
  border: 8px solid var(--shell-edge);
  border-radius: 48px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 22px 52px rgba(35, 26, 32, 0.16), inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.card {
  width: 100%;
  min-width: 0;
  min-height: 560px;
  display: grid;
  align-content: center;
  gap: 26px;
  padding: clamp(28px, 7vw, 46px);
  border: 4px solid var(--ink);
  border-radius: 32px;
  background: rgba(255, 253, 251, 0.94);
  box-shadow: 10px 12px 0 rgba(24, 21, 25, 0.12);
  transform-origin: center;
}

.scene {
  display: grid;
  gap: 24px;
  min-width: 0;
  animation: rise-in 360ms ease both;
}

.scene-header {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.scene-final h1 {
  font-size: clamp(30px, 7.4vw, 42px);
}

.sticker,
.avatar {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border: 4px solid var(--ink);
  border-radius: 25px;
  background: var(--pink);
  box-shadow: 10px 8px 0 var(--pink-soft), 4px 6px 0 var(--shadow);
  font-size: 46px;
  line-height: 1;
}

.avatar {
  background: #fff4eb;
  overflow: hidden;
  font-size: 58px;
}

.avatar span {
  transform: translateY(3px);
}

h1 {
  width: 100%;
  max-width: 100%;
  margin: 0;
  font-size: clamp(38px, 9vw, 52px);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: clamp(15px, 3.9vw, 18px);
  font-weight: 700;
  line-height: 1.5;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
}

.btn {
  min-height: 58px;
  border: 4px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  box-shadow: 6px 8px 0 var(--shadow);
  cursor: pointer;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  touch-action: manipulation;
}

.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 6px 0 var(--shadow);
}

.btn:active {
  transform: translate(5px, 6px);
  box-shadow: 1px 2px 0 var(--shadow);
}

.btn:focus-visible,
.food-option:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

.btn-primary {
  background: var(--pink);
}

.btn-wide {
  width: 100%;
}

.btn-dodge {
  transition: transform 180ms ease, box-shadow 160ms ease;
}

.btn-dodge.is-running {
  transform: translate(var(--run-x, 16px), var(--run-y, -8px)) rotate(var(--run-r, -2deg));
}

.hint-line {
  min-height: 24px;
  margin: -8px 0 0;
  color: #c32c90;
  font-weight: 900;
  text-align: center;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  font-weight: 900;
}

.field label {
  color: var(--muted);
}

input,
select {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 4px solid var(--ink);
  border-radius: 15px;
  color: var(--ink);
  background: #fff;
  box-shadow: 5px 7px 0 rgba(24, 21, 25, 0.16);
  font-weight: 900;
}

select {
  appearance: auto;
}

.food-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.food-option {
  min-height: 96px;
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 10px 6px;
  border: 4px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  box-shadow: 6px 7px 0 var(--shadow);
  cursor: pointer;
  font-weight: 900;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.food-option-other {
  grid-column: 2;
}

.food-option:hover,
.food-option.is-selected {
  border-color: var(--pink);
  background: var(--pink-soft);
  transform: translate(2px, 2px);
  box-shadow: 4px 5px 0 var(--pink);
}

.food-emoji {
  font-size: 30px;
  line-height: 1;
}

.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.summary-item {
  min-height: 88px;
  padding: 14px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  box-shadow: 5px 6px 0 rgba(24, 21, 25, 0.18);
}

.summary-item:last-child {
  grid-column: 1 / -1;
}

.summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--pink);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.summary-value {
  font-size: 21px;
  font-weight: 900;
}

.heart-strip {
  display: flex;
  justify-content: center;
  gap: 18px;
  color: var(--pink);
  font-size: 20px;
  animation: pulse 1300ms ease-in-out infinite;
}

.share-button {
  margin-top: -4px;
}

.share-status {
  min-height: 24px;
  margin: -14px 0 -4px;
  color: #c32c90;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
}

.scene-memory {
  gap: 18px;
}

.memory-card {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 28px;
  background: #171823;
  box-shadow: 8px 10px 0 rgba(24, 21, 25, 0.18);
  isolation: isolate;
}

.memory-photo,
.final-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 17, 24, 0.08) 0%, rgba(18, 17, 24, 0.24) 38%, rgba(18, 17, 24, 0.92) 100%),
    radial-gradient(circle at 80% 10%, rgba(255, 222, 112, 0.22), transparent 11rem);
}

.memory-light .memory-scrim,
.memory-album .memory-scrim {
  background:
    linear-gradient(180deg, rgba(255, 250, 246, 0.02) 0%, rgba(255, 250, 246, 0.18) 38%, rgba(255, 250, 246, 0.96) 100%);
}

.memory-copy {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 10px;
  padding: 22px;
  color: #fff8ef;
  background: linear-gradient(180deg, rgba(18, 17, 24, 0), rgba(18, 17, 24, 0.74) 20%, rgba(18, 17, 24, 0.88));
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.34);
}

.memory-light .memory-copy,
.memory-album .memory-copy {
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 250, 246, 0), rgba(255, 250, 246, 0.82) 20%, rgba(255, 250, 246, 0.96));
  text-shadow: none;
}

.memory-copy h1 {
  font-size: clamp(27px, 7vw, 38px);
}

.memory-copy p {
  margin: 0;
  font-size: clamp(15px, 3.8vw, 17px);
  font-weight: 900;
  line-height: 1.45;
}

.memory-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.memory-meta span {
  padding: 6px 10px;
  border: 2px solid currentColor;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.memory-light .memory-meta span,
.memory-album .memory-meta span {
  background: rgba(255, 255, 255, 0.74);
}

.memory-controls {
  display: grid;
  gap: 16px;
}

.memory-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.memory-dots span {
  width: 10px;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
}

.memory-dots span.is-active {
  background: var(--pink);
}

.scene-final-photo {
  gap: 16px;
}

.final-photo-card {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 28px;
  background: #171413;
  box-shadow: 8px 10px 0 rgba(24, 21, 25, 0.18);
  isolation: isolate;
}

.final-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 13, 12, 0.06) 0%, rgba(20, 13, 12, 0.25) 40%, rgba(20, 13, 12, 0.92) 100%),
    radial-gradient(circle at 18% 16%, rgba(255, 226, 137, 0.28), transparent 11rem);
}

.final-content {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 9px;
  padding: 20px;
  color: #fff8ef;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.48);
}

.final-content h1 {
  font-size: clamp(28px, 6.8vw, 38px);
}

.final-content p {
  margin: 0;
  font-size: clamp(14px, 3.6vw, 16px);
  font-weight: 900;
  line-height: 1.45;
}

.final-kicker {
  width: fit-content;
  padding: 6px 10px;
  border: 2px solid rgba(255, 248, 239, 0.92);
  border-radius: 999px;
  color: #fff8ef;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.floating-flower {
  position: absolute;
  z-index: 2;
  color: var(--pink);
  font-size: 28px;
  text-shadow: 0 2px 0 #c72d90;
  pointer-events: none;
  animation: drift 4s ease-in-out infinite;
}

.flower-one {
  top: 18%;
  left: 10%;
}

.flower-two {
  right: 12%;
  bottom: 17%;
  animation-delay: 700ms;
}

.flower-three {
  top: 8%;
  left: 52%;
  font-size: 24px;
  animation-delay: 1200ms;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translateY(0) rotate(-5deg);
  }
  50% {
    transform: translateY(-12px) rotate(7deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@media (max-width: 420px) {
  .phone-shell {
    width: calc(100vw - 24px);
    min-height: calc(100dvh - 24px);
    padding: 24px 12px;
    border-width: 6px;
    border-radius: 34px;
  }

  .card {
    width: 100%;
    min-height: 520px;
    padding: 30px 16px;
    border-width: 3px;
    border-radius: 26px;
  }

  .sticker,
  .avatar {
    width: 76px;
    height: 76px;
    border-radius: 21px;
    font-size: 38px;
  }

  .avatar {
    font-size: 48px;
  }

  h1 {
    font-size: clamp(31px, 8.7vw, 37px);
  }

  .scene-final h1 {
    font-size: clamp(27px, 7.2vw, 31px);
  }

  .subtitle {
    font-size: 15px;
  }

  .button-row {
    gap: 10px;
  }

  .btn {
    min-height: 54px;
    border-width: 3px;
    box-shadow: 5px 7px 0 var(--shadow);
  }

  .food-grid {
    gap: 10px;
  }

  .food-option {
    min-height: 86px;
    border-width: 3px;
    font-size: 14px;
  }

  .memory-card {
    min-height: 360px;
    border-width: 3px;
    border-radius: 24px;
  }

  .memory-copy {
    padding: 18px;
  }

  .memory-copy h1 {
    font-size: clamp(24px, 7vw, 30px);
  }

  .final-photo-card {
    min-height: 260px;
    border-width: 3px;
    border-radius: 24px;
  }

  .final-content {
    padding: 18px;
  }

  .final-content h1 {
    font-size: clamp(25px, 6.6vw, 29px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
