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

body {
  background: #f0f0f0;
  display: flex;
  justify-content: center;
}

.page {
  position: relative;
  width: 390px;
  min-height: 1865px;
  overflow: hidden;
}

/* Background image */
.subpage-bg {
  position: absolute;
  height: 1777px;
  left: 0;
  top: 0;
  width: 390px;
  overflow: hidden;
  pointer-events: none;
}
.bg-img {
  position: absolute;
  height: 239.13%;
  left: -941.65%;
  max-width: none;
  top: -139.11%;
  width: 1453.34%;
}

/* Green footer */
.footer {
  position: absolute;
  background-color: #33AD8B;
  height: 106px;
  left: 0;
  top: 1777px;
  width: 390px;
}

/* Guide heading */
.guide-heading {
  position: absolute;
  height: 86px;
  left: 3px;
  overflow: hidden;
  top: 14px;
  width: 390px;
}

.frag {
  position: absolute;
  height: 38px;
  left: 10px;
  top: 43px;
  width: 28.644px;
}
.frag svg {
  display: block;
  width: 100%;
  height: 100%;
}

.guide-title {
  position: absolute;
  font-family: 'Noto Sans', 'Noto Sans JP', sans-serif;
  font-weight: 600;
  font-size: 36px;
  color: #5C5C5C;
  white-space: nowrap;
  left: 47px;
  top: 37px;
  line-height: normal;
}

.menu-button {
  position: absolute;
  height: 50px;
  left: 313px;
  top: 0;
  width: 51px;
}
.menu-button svg {
  position: absolute;
  display: block;
  inset: 0;
  width: 100%;
  height: 100%;
}
.menu-line {
  position: absolute;
  left: 8px;
  width: 34px;
  height: 1px;
  background-color: #F8FAF7;
}
.menu-line1 { top: 12.5px; }
.menu-line2 { top: 22px; }
.menu-label {
  position: absolute;
  left: 50%;
  top: 25px;
  transform: translateX(-50%);
  font-family: 'Arimo', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: #F8FAF7;
  white-space: nowrap;
  text-align: center;
  line-height: normal;
}

/* Steps container */
.steps {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 99px;
  left: calc(50% - 145px);
  top: 170px;
  width: 290px;
}

.step-wrapper {
  position: relative;
}

.step-label {
  position: absolute;
  font-family: 'Arimo', 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 40px;
  color: #231916;
  white-space: nowrap;
  left: 0;
  top: -50px;
  line-height: normal;
}

/* Card */
.card {
  position: relative;
  background-color: #F8FAF7;
  height: 443px;
  border-radius: 20px;
  width: 100%;
}

/* Illustration box */
.illus-box {
  position: absolute;
  height: 173px;
  left: 43px;
  border-radius: 20px;
  top: 41px;
  width: 207px;
  border: 2px solid #5C5C5C;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
}
.illus-box svg {
  display: block;
  flex-shrink: 0;
}
.illus-box--step1 {
  padding: 41px 43px 27px 45px;
}
.illus-box--step1 svg {
  width: 118.647px;
  height: 105px;
}
.illus-box--step2 {
  padding: 40px 58px 9px 65px;
}
.illus-box--step2 svg {
  width: 84.114px;
  height: 123.331px;
}
.illus-box--step3 {
  padding: 22px 61px 0 44px;
}
.illus-box--step3 svg {
  width: 102.237px;
  height: 151.5px;
}

/* Text block */
.text-block {
  position: absolute;
  left: 40px;
  top: 230px;
  width: 210px;
}

.step-title {
  font-family: 'Noto Sans', 'Noto Sans JP', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: #42301D;
  white-space: nowrap;
  line-height: normal;
  margin-left: 3px;
}

.underline {
  height: 1px;
  background-color: #E16B8C;
  margin-top: 6px;
  margin-left: 3px;
}

.step-desc {
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 500;
  font-size: 12px;
  color: #42301D;
  line-height: normal;
  margin-top: 8px;
  word-break: break-word;
}

/* できた！button */
.done-btn {
  position: absolute;
  background-color: #E16B8C;
  display: flex;
  align-items: center;
  justify-content: center;
  left: 168px;
  padding-left: 5px;
  border-radius: 20px;
  top: 394px;
  width: 113px;
  border: none;
  cursor: pointer;
  font-family: 'Zen Kaku Gothic New', sans-serif;
  font-weight: 500;
  font-size: 24px;
  color: #F8FAF7;
  white-space: nowrap;
  line-height: normal;
  transition: background-color 0.2s;
}
.done-btn.done {
  background-color: #33AD8B;
}

/* Back button */
.back-btn {
  position: absolute;
  background-color: #F8FAF7;
  display: flex;
  height: 27px;
  align-items: center;
  justify-content: center;
  left: calc(50% + 34px);
  border-radius: 20px;
  top: 1838px;
  width: 143px;
  cursor: pointer;
  font-family: 'Arimo', 'Noto Sans JP', sans-serif;
  font-weight: 400;
  font-size: 12px;
  color: #42301D;
  text-align: center;
  white-space: nowrap;
  line-height: normal;
}

/* ===== Added interactions only: no layout coordinates changed ===== */
.card {
  transform-origin: center;
}
.card.is-growing {
  animation: card-bounce 0.45s ease-out;
}

.illus-switch {
  position: absolute;
  inset: 0;
  display: none;
  overflow: hidden;
  pointer-events: none;
}
.illus-box.has-illus-images {
  border: none;
}
.illus-box.has-illus-images > svg {
  opacity: 0;
}
.illus-box.has-illus-images .illus-switch {
  display: block;
}
.step-illus {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
  transform: scale(1);
  transform-origin: center;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.step-illus--after {
  opacity: 0;
  transform: scale(0.96);
}
.card.is-done .step-illus--before {
  opacity: 0;
  transform: scale(0.98);
}
.card.is-done .step-illus--after {
  opacity: 1;
  transform: scale(1);
}
.card.is-growing .step-illus--after {
  animation: image-grow 0.45s ease-out both;
}

.growth-particles {
  position: absolute;
  left: 62px;
  top: 108px;
  width: 160px;
  height: 96px;
  overflow: visible;
  pointer-events: none;
}
.growth-particles span {
  position: absolute;
  left: 50%;
  top: 70px;
  width: 12px;
  height: 8px;
  background: #F8FAF7;
  border-radius: 70% 20% 70% 20%;
  opacity: 0;
  transform: translate(0, 0) rotate(-18deg) scale(0.6);
  animation: float-leaf 0.85s ease-out both;
}
.growth-particles span:nth-child(1) {
  --leaf-x: -18px;
  animation-delay: 0.05s;
}
.growth-particles span:nth-child(2) {
  --leaf-x: 10px;
  width: 10px;
  height: 7px;
  background: #DDEFE6;
  animation-delay: 0.14s;
}
.growth-particles span:nth-child(3) {
  --leaf-x: 22px;
  width: 9px;
  height: 9px;
  border-radius: 70% 30% 70% 30%;
  animation-delay: 0.22s;
}
.growth-particles span:nth-child(4) {
  --leaf-x: -6px;
  width: 11px;
  height: 8px;
  background: #F6EEF0;
  animation-delay: 0.29s;
}

.forest-finale {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
}
.forest-finale span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  opacity: 0;
  transform: translate3d(0, 0, 0) scale(var(--scale, 1));
  animation: forest-finale-float 2s ease-out var(--delay, 0s) forwards;
  will-change: transform, opacity;
}
.forest-finale .finale-note {
  color: var(--color, #33AD8B);
  font-family: 'Arimo', sans-serif;
  font-size: var(--size, 18px);
  line-height: 1;
}
.forest-finale .finale-leaf,
.forest-finale .finale-petal {
  width: 13px;
  height: 8px;
}
.forest-finale .finale-leaf {
  background: #33AD8B;
  border-radius: 75% 20% 75% 25%;
}
.forest-finale .finale-petal {
  background: #E16B8C;
  border-radius: 75% 25% 75% 25%;
}

@keyframes card-bounce {
  0% { transform: scale(1); }
  35% { transform: scale(0.95); }
  68% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes image-grow {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float-leaf {
  0% {
    opacity: 0;
    transform: translate(0, 0) rotate(-18deg) scale(0.6);
  }
  18% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translate(var(--leaf-x, 12px), -58px) rotate(24deg) scale(1);
  }
}

@keyframes forest-finale-float {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(var(--rot, -8deg)) scale(var(--scale, 1));
  }
  16% {
    opacity: var(--peak, 0.65);
  }
  55% {
    opacity: calc(var(--peak, 0.65) * 0.82);
    transform: translate3d(var(--drift-mid, 10px), -72px, 0) rotate(var(--rot-mid, 8deg)) scale(var(--scale, 1));
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift-end, -6px), -150px, 0) rotate(var(--rot-end, 14deg)) scale(var(--scale, 1));
  }
}
