/* FORTUNE_TREE_SELECTION_STEP1_V1_START */

.fortune-page {
  --fortune-purple: #7754c7;
  --fortune-purple-deep: #4f368f;
  --fortune-lilac: #eee7ff;
  --fortune-cream: #fffaf2;
  --fortune-ink: #352d43;
  --fortune-muted: #746b82;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 72px;
  color: var(--fortune-ink);
}

.fortune-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid rgba(119, 84, 199, 0.2);
  border-radius: 30px;
  background:
    radial-gradient(circle at 82% 18%, rgba(183, 151, 255, 0.3), transparent 32%),
    linear-gradient(145deg, #fffaf4 0%, #f3ecff 56%, #fbf6ff 100%);
  box-shadow: 0 20px 54px rgba(82, 57, 128, 0.12);
  text-align: center;
}

.fortune-hero::after {
  content: "✦";
  position: absolute;
  right: 8%;
  bottom: 8%;
  font-size: clamp(72px, 12vw, 150px);
  color: rgba(119, 84, 199, 0.08);
  transform: rotate(14deg);
  pointer-events: none;
}

.fortune-hero__back {
  position: absolute;
  top: 22px;
  left: 24px;
  z-index: 1;
  color: var(--fortune-purple-deep);
  font-weight: 800;
  text-decoration: none;
}

.fortune-hero__eyebrow,
.fortune-panel__step {
  margin: 0 0 10px;
  color: var(--fortune-purple);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fortune-hero__title {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.55rem);
  line-height: 1.14;
  letter-spacing: -0.055em;
}

.fortune-hero__description {
  margin: 18px auto 0;
  color: var(--fortune-muted);
  font-size: clamp(0.96rem, 2vw, 1.13rem);
  line-height: 1.8;
}

.fortune-panel {
  margin-top: 26px;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid rgba(119, 84, 199, 0.16);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 48px rgba(73, 51, 112, 0.09);
}

.fortune-panel__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.fortune-panel__heading h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  letter-spacing: -0.04em;
}

.fortune-panel__heading p:not(.fortune-panel__step) {
  margin: 9px 0 0;
  color: var(--fortune-muted);
  line-height: 1.65;
}

.fortune-counter {
  flex: 0 0 auto;
  min-width: 92px;
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--fortune-lilac);
  color: var(--fortune-purple-deep);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(119, 84, 199, 0.13);
}

.fortune-counter strong {
  font-size: 1.6rem;
}

.fortune-counter span {
  margin-left: 3px;
  font-weight: 800;
}

.fortune-loading {
  padding: 50px 20px;
  color: var(--fortune-muted);
  text-align: center;
}

.fortune-card-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: clamp(8px, 1.4vw, 14px);
}

.fortune-card-choice {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: pointer;
  perspective: 900px;
  transition: transform 180ms ease, filter 180ms ease;
}

.fortune-card-choice:hover {
  transform: translateY(-5px);
  filter: drop-shadow(0 12px 12px rgba(64, 45, 103, 0.2));
}

.fortune-card-choice:focus-visible {
  outline: 3px solid rgba(119, 84, 199, 0.5);
  outline-offset: 4px;
}

.fortune-card-choice__inner {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 0.6;
  border-radius: 10px;
  transform-style: preserve-3d;
  transition: transform 480ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.fortune-card-choice.is-selected .fortune-card-choice__inner {
  transform: rotateY(180deg);
}

.fortune-card-choice__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 10px;
  backface-visibility: hidden;
  box-shadow: 0 5px 15px rgba(46, 31, 78, 0.2);
}

.fortune-card-choice__face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fortune-card-choice__front {
  transform: rotateY(180deg);
}

.fortune-card-choice__order {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--fortune-purple);
  color: white;
  font-size: 0.82rem;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.7);
  transition: 180ms ease;
}

.fortune-card-choice.is-selected .fortune-card-choice__order {
  opacity: 1;
  transform: scale(1);
}

.fortune-card-choice.is-locked:not(.is-selected) {
  cursor: not-allowed;
  filter: grayscale(0.4) opacity(0.46);
}

.fortune-selection__actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.fortune-button {
  min-height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 15px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.fortune-button:not(:disabled):hover {
  transform: translateY(-2px);
}

.fortune-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.fortune-button--primary {
  min-width: min(280px, 60vw);
  background: linear-gradient(135deg, #8d6adc, #6746b7);
  color: white;
  box-shadow: 0 12px 25px rgba(102, 70, 183, 0.27);
}

.fortune-button--ghost {
  border: 1px solid rgba(119, 84, 199, 0.2);
  background: #f8f4ff;
  color: var(--fortune-purple-deep);
}

.fortune-status {
  margin: 17px 0 0;
  color: var(--fortune-muted);
  text-align: center;
}

.fortune-tree-scroll {
  overflow-x: auto;
  padding: 8px 0 14px;
  scrollbar-color: rgba(119, 84, 199, 0.35) transparent;
}

.fortune-tree-stage {
  position: relative;
  width: min(100%, 1120px);
  min-width: 760px;
  aspect-ratio: 1586 / 992;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 26px;
  background: #4e4376;
  box-shadow: 0 24px 55px rgba(49, 34, 86, 0.25);
}

.fortune-tree-stage__background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.fortune-tree-slot {
  --slot-width: 10.4%;
  position: absolute;
  z-index: 2;
  width: var(--slot-width);
  transform: translate(-50%, -50%);
}

.fortune-tree-slot::before {
  content: "";
  position: absolute;
  inset: -10% -12%;
  z-index: -1;
  border-radius: 14px;
  background: radial-gradient(ellipse, rgba(79, 54, 143, 0.94) 0%, rgba(79, 54, 143, 0.82) 58%, rgba(79, 54, 143, 0) 74%);
  filter: blur(2px);
}

.fortune-tree-slot--1 { left: 41.3%; top: 49.8%; }
.fortune-tree-slot--2 { left: 54.5%; top: 39.6%; }
.fortune-tree-slot--3 { left: 49.2%; top: 77.1%; }
.fortune-tree-slot--4 { left: 25.0%; top: 65.0%; }
.fortune-tree-slot--5 { left: 70.5%; top: 64.6%; }
.fortune-tree-slot--6 { left: 28.4%; top: 17.0%; }
.fortune-tree-slot--7 { left: 49.0%; top: 14.6%; }
.fortune-tree-slot--8 { left: 70.7%; top: 17.4%; }

.fortune-tree-card {
  position: relative;
}

.fortune-tree-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 0.6;
  object-fit: cover;
  border: 3px solid rgba(255, 248, 222, 0.96);
  border-radius: 9px;
  background: #fff8e8;
  box-shadow:
    0 0 0 2px rgba(113, 80, 183, 0.58),
    0 11px 26px rgba(34, 20, 62, 0.52),
    0 0 24px rgba(241, 214, 255, 0.55);
}

.fortune-tree-card__number {
  position: absolute;
  top: -13px;
  left: 50%;
  display: grid;
  place-items: center;
  width: clamp(25px, 2.7vw, 36px);
  height: clamp(25px, 2.7vw, 36px);
  border: 3px solid white;
  border-radius: 50%;
  background: #7b5ac8;
  color: white;
  font-size: clamp(0.72rem, 1.2vw, 1rem);
  font-weight: 900;
  transform: translate(-50%, -55%);
  box-shadow: 0 5px 13px rgba(47, 30, 86, 0.32);
}

.fortune-tree-card__meaning {
  position: absolute;
  left: 50%;
  bottom: -7px;
  max-width: 145%;
  padding: 4px 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: rgba(65, 43, 111, 0.9);
  color: white;
  font-size: clamp(0.48rem, 0.72vw, 0.7rem);
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translate(-50%, 100%);
  backdrop-filter: blur(4px);
}

.fortune-position-guide {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.fortune-position-guide article {
  padding: 16px;
  border: 1px solid rgba(119, 84, 199, 0.13);
  border-radius: 16px;
  background: linear-gradient(145deg, #fffdf9, #f7f2ff);
}

.fortune-position-guide b,
.fortune-position-guide span {
  display: block;
}

.fortune-position-guide b {
  color: var(--fortune-purple-deep);
}

.fortune-position-guide span {
  margin-top: 5px;
  color: var(--fortune-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.fortune-next-step {
  margin-top: 22px;
  padding: 20px;
  border-radius: 18px;
  background: #f2ebff;
  text-align: center;
}

.fortune-next-step p {
  margin: 0 0 4px;
  color: var(--fortune-muted);
}

.fortune-next-step strong {
  color: var(--fortune-purple-deep);
}

@media (max-width: 900px) {
  .fortune-card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .fortune-position-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .fortune-page {
    width: min(100%, calc(100% - 20px));
    padding-top: 12px;
  }

  .fortune-hero,
  .fortune-panel {
    border-radius: 22px;
  }

  .fortune-hero {
    padding: 66px 20px 30px;
  }

  .fortune-hero__back {
    top: 19px;
    left: 20px;
  }

  .fortune-panel {
    padding: 20px 14px;
  }

  .fortune-panel__heading,
  .fortune-panel__heading--tree {
    display: block;
  }

  .fortune-counter {
    width: fit-content;
    margin-top: 15px;
  }

  .fortune-panel__heading--tree .fortune-button {
    margin-top: 16px;
  }

  .fortune-card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
  }

  .fortune-card-choice__order {
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    border-width: 2px;
    font-size: 0.7rem;
  }

  .fortune-selection__actions {
    position: sticky;
    bottom: 8px;
    z-index: 10;
    padding: 9px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
  }

  .fortune-button {
    min-height: 48px;
    padding: 0 13px;
    font-size: 0.9rem;
  }

  .fortune-button--primary {
    min-width: 0;
    flex: 1;
  }

  .fortune-position-guide {
    grid-template-columns: 1fr;
  }
}

/* FORTUNE_MOBILE_FIT_STEP3_V1_START */

/* 모바일에서 나무와 카드 8장을 좌우 스크롤 없이 한 화면에 표시 */
@media (max-width: 900px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .fortune-page,
  .fortune-panel,
  .fortune-tree-result,
  .fortune-tree-scroll,
  .fortune-tree-stage {
    box-sizing: border-box;
    max-width: 100%;
  }

  .fortune-page {
    width: 100%;
    overflow-x: clip;
  }

  .fortune-panel {
    width: calc(100% - 20px);
    margin-right: auto;
    margin-left: auto;
  }

  .fortune-tree-result {
    overflow: hidden;
  }

  .fortune-tree-scroll {
    width: 100%;
    overflow: hidden;
    padding: 0;
  }

  .fortune-tree-stage {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 430px !important;
    height: clamp(480px, calc(100svh - 250px), 620px);
    min-height: 0;
    aspect-ratio: auto !important;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 18px;
  }

  .fortune-tree-stage__background {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }

  .fortune-tree-slot {
    --slot-width: 14.2%;
    width: var(--slot-width) !important;
  }

  /* 사용자 확정 배열: 6·7·8 / 2 / 4·1·5 / 3 */
  .fortune-tree-slot--6 { left: 18%; top: 14%; }
  .fortune-tree-slot--7 { left: 50%; top: 11.5%; }
  .fortune-tree-slot--8 { left: 82%; top: 14%; }
  .fortune-tree-slot--2 { left: 50%; top: 34.5%; }
  .fortune-tree-slot--4 { left: 18%; top: 56.5%; }
  .fortune-tree-slot--1 { left: 50%; top: 54.5%; }
  .fortune-tree-slot--5 { left: 82%; top: 56.5%; }
  .fortune-tree-slot--3 { left: 50%; top: 81.5%; }

  .fortune-tree-card__image {
    width: 100%;
    border-width: 1px;
    border-radius: 6px;
    box-shadow:
      0 0 0 1px rgba(113, 80, 183, 0.62),
      0 6px 13px rgba(34, 20, 62, 0.38),
      0 0 11px rgba(241, 214, 255, 0.38);
  }

  .fortune-tree-card__number {
    top: -7px;
    width: 22px;
    height: 22px;
    border-width: 2px;
    font-size: 0.67rem;
    transform: translate(-50%, -45%);
  }

  /* 나무 위 긴 의미 라벨은 숨기고 번호만 남김 */
  .fortune-tree-card__meaning {
    display: none !important;
  }

  .fortune-position-guide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  .fortune-position-guide article {
    min-width: 0;
    padding: 10px;
    border-radius: 12px;
  }

  .fortune-position-guide b {
    font-size: 0.79rem;
  }

  .fortune-position-guide span {
    margin-top: 3px;
    font-size: 0.7rem;
    line-height: 1.4;
  }

  .fortune-next-step {
    margin-top: 14px;
    padding: 14px 10px;
  }

  .fortune-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 430px) {
  .fortune-panel {
    width: calc(100% - 16px);
  }

  .fortune-tree-result {
    padding-right: 7px;
    padding-left: 7px;
  }

  .fortune-tree-stage {
    height: clamp(470px, calc(100svh - 245px), 590px);
    border-radius: 16px;
  }

  .fortune-tree-slot {
    --slot-width: 14.6%;
  }

  .fortune-tree-slot--6 { left: 17.5%; top: 14%; }
  .fortune-tree-slot--8 { left: 82.5%; top: 14%; }
  .fortune-tree-slot--4 { left: 17.5%; top: 56.5%; }
  .fortune-tree-slot--5 { left: 82.5%; top: 56.5%; }
}

/* FORTUNE_MOBILE_FIT_STEP3_V1_END */

/* FORTUNE_TREE_FINAL_STEP6_START */

/* /fortune 나무 영역 전용 최종 규칙 */

.fortune-tree-stage {
  position: relative !important;
  isolation: isolate;
  width: min(100%, 900px) !important;
  max-width: 900px !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 4 / 3 !important;
  margin-right: auto !important;
  margin-left: auto !important;
  overflow: hidden !important;
  border-radius: 22px;
  background: #58447e;
  box-shadow: 0 18px 44px rgba(49, 34, 86, 0.21);
}

.fortune-tree-stage__picture {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  overflow: hidden;
  pointer-events: none;
}

.fortune-tree-stage__background {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  user-select: none;
  pointer-events: none;
  transform-origin: 50% 78%;
  will-change: transform, filter;
  animation: fortuneFinalTreeSway 9.5s ease-in-out infinite;
}

.fortune-tree-cosmic-effects {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.fortune-tree-cosmic-effects::before {
  content: "";
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(ellipse at 16% 17%, rgba(224,207,255,.34) 0%, rgba(192,164,255,.14) 25%, transparent 54%),
    radial-gradient(ellipse at 82% 14%, rgba(202,229,255,.29) 0%, rgba(197,174,255,.11) 28%, transparent 56%),
    linear-gradient(128deg, transparent 27%, rgba(236,220,255,.09) 43%, rgba(194,172,255,.16) 51%, rgba(223,235,255,.08) 59%, transparent 73%);
  mix-blend-mode: screen;
  opacity: .44;
  filter: blur(1px);
  animation: fortuneFinalGalaxyBreath 7.5s ease-in-out infinite;
}

.fortune-tree-cosmic-effects::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.96) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(255,229,252,.88) 0 1.2px, transparent 2.1px),
    radial-gradient(circle, rgba(207,191,255,.82) 0 1px, transparent 1.9px);
  background-size: 89px 89px, 137px 137px, 191px 191px;
  background-position: 11px 17px, 56px 73px, 103px 31px;
  opacity: .27;
  animation: fortuneFinalTwinkle 4.6s ease-in-out infinite alternate;
}

.fortune-final-shooting-star {
  position: absolute;
  left: -32%;
  width: clamp(80px, 17vw, 155px);
  height: 2px;
  border-radius: 999px;
  opacity: 0;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(231,218,255,.68) 40%, rgba(255,255,255,.98) 100%);
  filter: drop-shadow(0 0 4px rgba(255,255,255,.95)) drop-shadow(0 0 10px rgba(188,157,255,.72));
  transform: rotate(-24deg);
  animation: fortuneFinalShootingStar 10s linear infinite;
}

.fortune-final-shooting-star::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 7px rgba(255,255,255,1), 0 0 15px rgba(200,173,255,.92);
  transform: translateY(-50%);
}

.fortune-final-shooting-star:nth-child(1) {
  top: 11%;
  animation-delay: 0s;
}

.fortune-final-shooting-star:nth-child(2) {
  top: 24%;
  animation-delay: 3.8s;
  animation-duration: 12.5s;
}

.fortune-final-shooting-star:nth-child(3) {
  top: 17%;
  animation-delay: 7.2s;
  animation-duration: 14s;
}

.fortune-tree-slot,
.fortune-tree-card {
  z-index: 5 !important;
}

@media (min-width: 901px) {
  .fortune-tree-slot {
    --slot-width: 10.3%;
  }

  .fortune-tree-slot--1 { left: 41.3%; top: 49.8%; }
  .fortune-tree-slot--2 { left: 54.5%; top: 39.6%; }
  .fortune-tree-slot--3 { left: 49.2%; top: 77.1%; }
  .fortune-tree-slot--4 { left: 25%; top: 65%; }
  .fortune-tree-slot--5 { left: 70.5%; top: 64.6%; }
  .fortune-tree-slot--6 { left: 28.4%; top: 17%; }
  .fortune-tree-slot--7 { left: 49%; top: 14.6%; }
  .fortune-tree-slot--8 { left: 70.7%; top: 17.4%; }
}

@keyframes fortuneFinalTreeSway {
  0%, 100% {
    transform: scale(1.012) translate3d(0, 0, 0) rotate(0deg);
    filter: brightness(1);
  }
  25% {
    transform: scale(1.016) translate3d(-1px, -1px, 0) rotate(-0.22deg);
    filter: brightness(1.015);
  }
  50% {
    transform: scale(1.013) translate3d(1px, 0, 0) rotate(0.08deg);
    filter: brightness(1.005);
  }
  75% {
    transform: scale(1.017) translate3d(1px, -1px, 0) rotate(0.24deg);
    filter: brightness(1.02);
  }
}

@keyframes fortuneFinalGalaxyBreath {
  0%, 100% {
    opacity: .34;
    transform: translate3d(-.5%, 0, 0) scale(1);
  }
  50% {
    opacity: .62;
    transform: translate3d(.7%, -.4%, 0) scale(1.035);
  }
}

@keyframes fortuneFinalTwinkle {
  0% {
    opacity: .16;
    filter: brightness(.92);
  }
  55% {
    opacity: .43;
    filter: brightness(1.2);
  }
  100% {
    opacity: .24;
    filter: brightness(1.06);
  }
}

@keyframes fortuneFinalShootingStar {
  0%, 70% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(-24deg);
  }
  73% {
    opacity: 1;
  }
  84% {
    opacity: 1;
    transform: translate3d(150vw, 48vw, 0) rotate(-24deg);
  }
  85%, 100% {
    opacity: 0;
    transform: translate3d(150vw, 48vw, 0) rotate(-24deg);
  }
}

@media (max-width: 900px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .fortune-page,
  .fortune-panel,
  .fortune-tree-result,
  .fortune-tree-scroll,
  .fortune-tree-stage {
    box-sizing: border-box;
    max-width: 100%;
  }

  .fortune-tree-result {
    overflow: hidden;
  }

  .fortune-tree-scroll {
    width: 100%;
    overflow: hidden;
    padding: 0;
  }

  .fortune-tree-stage {
    width: 100% !important;
    max-width: 430px !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 9 / 16 !important;
    border-radius: 18px;
  }

  .fortune-tree-stage__background {
    object-fit: cover !important;
    object-position: center center !important;
    animation-duration: 10.8s;
  }

  .fortune-tree-slot {
    --slot-width: 14.2%;
    width: var(--slot-width) !important;
  }

  .fortune-tree-slot--6 { left: 18%; top: 14%; }
  .fortune-tree-slot--7 { left: 50%; top: 11.5%; }
  .fortune-tree-slot--8 { left: 82%; top: 14%; }
  .fortune-tree-slot--2 { left: 50%; top: 34.5%; }
  .fortune-tree-slot--4 { left: 18%; top: 56.5%; }
  .fortune-tree-slot--1 { left: 50%; top: 54.5%; }
  .fortune-tree-slot--5 { left: 82%; top: 56.5%; }
  .fortune-tree-slot--3 { left: 50%; top: 81.5%; }

  .fortune-tree-card__meaning {
    display: none !important;
  }

  .fortune-final-shooting-star {
    width: 76px;
    height: 1.5px;
  }

  .fortune-final-shooting-star:nth-child(3) {
    display: none;
  }
}

@media (max-width: 430px) {
  .fortune-tree-stage {
    border-radius: 16px;
  }

  .fortune-tree-slot {
    --slot-width: 14.6%;
  }

  .fortune-tree-slot--6 { left: 17.5%; }
  .fortune-tree-slot--8 { left: 82.5%; }
  .fortune-tree-slot--4 { left: 17.5%; }
  .fortune-tree-slot--5 { left: 82.5%; }
}

@media (prefers-reduced-motion: reduce) {
  .fortune-tree-stage__background,
  .fortune-tree-cosmic-effects::before,
  .fortune-tree-cosmic-effects::after,
  .fortune-final-shooting-star {
    animation: none !important;
  }

  .fortune-final-shooting-star {
    display: none;
  }
}

/* FORTUNE_TREE_FINAL_STEP6_END */

/* FORTUNE_SPARKLE_ONLY_STEP7_START */

/*
  /fortune 나무 영역 전용 보정
  - 나무 흔들림 제거
  - 은하수 흐름 제거
  - 별똥별 제거
  - 배경은 고정
  - 미세한 별빛 반짝임만 유지
*/

.fortune-tree-stage__background {
  animation: none !important;
  transform: none !important;
  filter: none !important;
  will-change: auto !important;
}

.fortune-tree-cosmic-effects::before {
  content: none !important;
  display: none !important;
  animation: none !important;
  background: none !important;
}

.fortune-final-shooting-star,
.fortune-final-shooting-star::after {
  display: none !important;
  animation: none !important;
}

.fortune-tree-cosmic-effects::after {
  content: "";
  position: absolute;
  inset: 0;
  display: block;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.94) 0 1px, transparent 1.8px),
    radial-gradient(circle, rgba(255,235,255,.82) 0 1.2px, transparent 2px),
    radial-gradient(circle, rgba(218,204,255,.78) 0 1px, transparent 1.9px);
  background-size:
    96px 96px,
    151px 151px,
    213px 213px;
  background-position:
    15px 21px,
    62px 79px,
    117px 36px;
  opacity: .22;
  filter: brightness(1);
  transform: none !important;
  animation: fortuneSparkleOnly 4.2s ease-in-out infinite alternate !important;
  pointer-events: none;
}

@keyframes fortuneSparkleOnly {
  0% {
    opacity: .14;
    filter: brightness(.96);
  }

  50% {
    opacity: .34;
    filter: brightness(1.12);
  }

  100% {
    opacity: .20;
    filter: brightness(1.02);
  }
}

@media (max-width: 900px) {
  .fortune-tree-cosmic-effects::after {
    opacity: .18;
    background-size:
      88px 88px,
      139px 139px,
      197px 197px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fortune-tree-cosmic-effects::after {
    animation: none !important;
    opacity: .22;
  }
}

/* FORTUNE_SPARKLE_ONLY_STEP7_END */

/* FORTUNE_PAID_PREVIEW_STEP8_START */

.fortune-paid-preview {
  box-sizing: border-box;
  width: min(100%, 900px);
  margin: 28px auto 0;
  padding: 30px;
  border: 1px solid rgba(121, 92, 172, 0.18);
  border-radius: 26px;
  background:
    radial-gradient(circle at 86% 12%, rgba(218, 201, 255, 0.30), transparent 34%),
    linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(249, 244, 255, 0.98));
  box-shadow: 0 18px 44px rgba(69, 46, 107, 0.12);
  color: #392f4d;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 320ms ease, transform 320ms ease;
}

.fortune-paid-preview.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fortune-paid-preview__eyebrow {
  margin-bottom: 10px;
  color: #8064ac;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.fortune-paid-preview h2 {
  margin: 0;
  color: #332844;
  font-size: clamp(1.42rem, 3vw, 2rem);
  line-height: 1.28;
  text-align: center;
}

.fortune-paid-preview__cards {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 610px);
  margin: 18px auto 20px;
}

.fortune-paid-preview__card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border: 1px solid rgba(114, 88, 158, 0.18);
  border-radius: 8px;
  background: #eee6f7;
  box-shadow: 0 5px 12px rgba(52, 39, 77, 0.12);
}

.fortune-paid-preview__card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fortune-paid-preview__card span {
  position: absolute;
  right: 3px;
  bottom: 3px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: rgba(46, 33, 68, 0.86);
  color: #fff;
  font-size: 0.67rem;
  font-weight: 800;
}

.fortune-paid-preview__position-note {
  margin: 0 auto 18px;
  color: #695d79;
  font-size: 0.92rem;
  line-height: 1.65;
  text-align: center;
}

.fortune-paid-preview__position-note strong {
  color: #4c3967;
}

.fortune-paid-preview__free {
  padding: 22px;
  border: 1px solid rgba(128, 100, 173, 0.15);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.fortune-paid-preview__free-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  background: #eee5fb;
  color: #72549f;
  font-size: 0.76rem;
  font-weight: 800;
}

.fortune-paid-preview__free p {
  margin: 13px 0 0;
  color: #40364f;
  font-size: 1rem;
  line-height: 1.8;
}

.fortune-paid-preview__divider {
  width: 64px;
  height: 1px;
  margin: 25px auto;
  background: linear-gradient(90deg, transparent, #bda8d7, transparent);
}

.fortune-paid-preview__locked {
  position: relative;
  padding: 23px;
  overflow: hidden;
  border: 1px solid rgba(109, 81, 153, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(245, 239, 252, 0.95), rgba(255, 255, 255, 0.96));
}

.fortune-paid-preview__locked-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.fortune-paid-preview__locked-heading span {
  color: #453754;
  font-size: 1.03rem;
  font-weight: 800;
}

.fortune-paid-preview__locked-heading strong {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #6f5195;
  color: #fff;
  font-size: 0.7rem;
}

.fortune-paid-preview__locked-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.fortune-paid-preview__locked-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(116, 88, 157, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.fortune-paid-preview__locked-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: #eee5f8;
  color: #725399;
  font-size: 0.9rem;
  font-weight: 900;
}

.fortune-paid-preview__locked-item strong {
  display: block;
  color: #4a3a5c;
  font-size: 0.88rem;
}

.fortune-paid-preview__locked-item small {
  display: block;
  margin-top: 4px;
  color: #8a7d96;
  font-size: 0.72rem;
  line-height: 1.4;
}

.fortune-paid-preview__lock {
  font-size: 0.8rem;
  opacity: 0.7;
}

.fortune-paid-preview__purchase {
  display: block;
  width: min(100%, 420px);
  min-height: 54px;
  margin: 22px auto 0;
  padding: 12px 20px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #73549e, #9979c3);
  box-shadow: 0 10px 22px rgba(91, 63, 130, 0.23);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.fortune-paid-preview__purchase:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 26px rgba(91, 63, 130, 0.27);
}

.fortune-paid-preview__purchase:active {
  transform: translateY(0);
}

.fortune-paid-preview__secure-note,
.fortune-paid-preview__checkout-message {
  margin: 10px 0 0;
  color: #84778f;
  font-size: 0.72rem;
  line-height: 1.5;
  text-align: center;
}

.fortune-paid-preview__checkout-message {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f0e8f8;
  color: #664b85;
  font-weight: 700;
}

@media (max-width: 700px) {
  .fortune-paid-preview {
    margin-top: 18px;
    padding: 20px 14px;
    border-radius: 20px;
  }

  .fortune-paid-preview__cards {
    gap: 4px;
    margin-top: 15px;
  }

  .fortune-paid-preview__card {
    border-radius: 5px;
  }

  .fortune-paid-preview__card span {
    right: 2px;
    bottom: 2px;
    width: 15px;
    height: 15px;
    font-size: 0.58rem;
  }

  .fortune-paid-preview__position-note {
    font-size: 0.82rem;
  }

  .fortune-paid-preview__free {
    padding: 17px;
  }

  .fortune-paid-preview__free p {
    font-size: 0.93rem;
  }

  .fortune-paid-preview__locked {
    padding: 16px 12px;
  }

  .fortune-paid-preview__locked-heading {
    display: block;
  }

  .fortune-paid-preview__locked-heading strong {
    display: inline-flex;
    margin-top: 8px;
  }

  .fortune-paid-preview__locked-list {
    grid-template-columns: 1fr;
  }

  .fortune-paid-preview__locked-item {
    min-height: 65px;
  }
}

/* FORTUNE_PAID_PREVIEW_STEP8_END */

/* =========================================================
   FORTUNE_TOSS_PAYMENT_STEP9_START
========================================================= */

.fortune-payment-message-step9 {
  margin: 12px 0 0;
  padding: 11px 14px;
  border-radius: 12px;
  background: #f2eafa;
  color: #60468a;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.fortune-payment-message-step9.is-success {
  background: #edf8f1;
  color: #27714b;
}

.fortune-payment-message-step9.is-error {
  background: #fff0f2;
  color: #b14355;
}

.fortune-paid-result-step9 {
  width: min(100%, 920px);
  margin: 24px auto;
  padding: 28px;
  box-sizing: border-box;
  border: 1px solid rgba(119, 79, 170, 0.2);
  border-radius: 24px;
  background:
    linear-gradient(
      180deg,
      rgba(248, 243, 255, 0.98),
      rgba(255, 255, 255, 0.98)
    );
  box-shadow:
    0 18px 50px
    rgba(90, 56, 135, 0.12);
}

.fortune-paid-result-step9__badge {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: #7955a7;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.fortune-paid-result-step9 h2 {
  margin: 14px 0 20px;
  color: #3d3150;
  font-size: 24px;
}

.fortune-paid-result-step9__summary {
  padding: 20px;
  border-radius: 18px;
  background: #f2eafa;
}

.fortune-paid-result-step9 article span {
  display: block;
  margin-bottom: 7px;
  color: #72549b;
  font-size: 12px;
  font-weight: 800;
}

.fortune-paid-result-step9 article p {
  margin: 0;
  color: #4e4659;
  line-height: 1.75;
}

.fortune-paid-result-step9__grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.fortune-paid-result-step9__grid article {
  padding: 17px;
  border: 1px solid #eadff4;
  border-radius: 16px;
  background: #fff;
}

.fortune-paid-result-step9__grid strong {
  display: block;
  margin-bottom: 7px;
  color: #47345f;
  font-size: 18px;
}

.fortune-paid-result-step9__positions {
  margin-top: 26px;
}

.fortune-paid-result-step9__positions h3 {
  margin: 0 0 14px;
  color: #423550;
}

.fortune-paid-result-step9__positions article {
  padding: 16px 0;
  border-bottom:
    1px solid rgba(119, 79, 170, 0.13);
}

.fortune-paid-result-step9__positions article > div {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
}

.fortune-paid-result-step9__positions b {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #efe4fb;
  color: #684890;
}

.fortune-paid-result-step9__positions strong {
  display: block;
  margin-bottom: 6px;
  color: #433253;
}

.fortune-paid-result-step9__saved {
  margin: 18px 0 0;
  color: #9b91a5;
  font-size: 11px;
  text-align: center;
}

@media (max-width: 640px) {
  .fortune-paid-result-step9 {
    margin: 16px 0;
    padding: 18px 14px;
    border-radius: 18px;
  }

  .fortune-paid-result-step9 h2 {
    font-size: 20px;
  }

  .fortune-paid-result-step9__grid {
    grid-template-columns: 1fr;
  }
}

/* FORTUNE_TOSS_PAYMENT_STEP9_END */
