@charset "UTF-8";
#fortune-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #f9dadd;
  z-index: 99999;
  animation: fortuneHide 1.5s ease-in-out 0.3s forwards;
}

.fortune-loader__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(225deg, rgb(245, 217, 234) 0%, rgba(255, 255, 255, 0) 40%, rgba(170, 236, 227, 0.281) 50%, rgba(255, 255, 255, 0) 60%, rgb(245, 217, 234) 100%);
  background-size: 300% 300%;
  background-position: 0% 100%;
  animation: fortuneRun 1.5s cubic-bezier(0.23, 1, 0.32, 0.6) forwards;
}

@keyframes fortuneRun {
  0% {
    background-position: 0% 100%;
  }
  100% {
    background-position: 100% 0%;
  }
}
@keyframes fortuneHide {
  0% {
    opacity: 1;
    visibility: visible;
  }
  100% {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
.p-fortune__img-wrap {
  margin: auto;
  max-width: 240px;
}
.p-fortune__img {
  width: 100%;
  height: auto;
}
.p-fortune__btn {
  max-width: 280px;
  padding: var(--int-s-2) var(--int-m-2);
}
.p-fortune__btn-icon {
  position: absolute;
  fill: var(--color-white);
  width: 14px;
  height: 14px;
}
.p-fortune__btn-icon--left {
  left: 16px;
}
.p-fortune__btn-icon--right {
  right: 16px;
}
.p-fortune__desc {
  max-width: 480px;
  margin-inline: auto;
}

.p-fortune-result__ogp {
  width: 100%;
  margin: 0 auto var(--int-m-2);
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
}

.p-fortune-result__wrap.u-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--int-m-1);
}
.p-fortune-result__wrap.u-container .p-fortune-result__message {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: var(--int-m-1);
  font-size: var(--font-size-sub-title);
  font-family: var(--font-family-letter);
}
.p-fortune-result__wrap.u-container .p-fortune-result__message::before, .p-fortune-result__wrap.u-container .p-fortune-result__message::after {
  content: "";
  display: block;
  width: 2px;
  height: 40px;
  background-color: var(--color-main-light-gray);
}
.p-fortune-result__wrap.u-container .p-fortune-result__points-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-items: center;
  gap: var(--int-m-1);
}
.p-fortune-result__wrap.u-container .p-fortune-result__points-box {
  max-width: fit-content;
  background-color: var(--color-white);
  border-radius: 24px;
  padding: var(--int-s-3) var(--int-m-2);
}
.p-fortune-result__wrap.u-container .p-fortune-result__points-box .points-label {
  margin-bottom: var(--int-s-2);
}
.p-fortune-result__wrap.u-container .p-fortune-result__points-box .points-value {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: var(--int-s-3);
}
.p-fortune-result__wrap.u-container .p-fortune-result__points-box .points-value .icon-piece {
  width: 24px;
  height: auto;
}
.p-fortune-result__wrap.u-container .p-fortune-result__total .total-label {
  margin-bottom: var(--int-s-1);
}
.p-fortune-result__wrap.u-container .p-fortune-result__total .total-value {
  font-size: var(--font-size-big-title);
}
.p-fortune-result__wrap.u-container .p-fortune-result__about-points {
  border: 1px solid var(--color-main-pink);
  border-radius: 16px;
  padding: var(--layout-inner-space-side);
}
.p-fortune-result__wrap.u-container .p-fortune-result__about-points .about-title {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  margin-bottom: 32px;
  font-size: var(--font-size-text-main);
}
.p-fortune-result__wrap.u-container .p-fortune-result__about-points .about-title .icon-arrow {
  display: inline-block;
  width: var(--img-size-pulldown-button);
  height: var(--img-size-pulldown-button);
  background: url("../img/portal/icon/icon_arrow_down_pink.svg") no-repeat center/contain;
  margin-left: var(--int-s-1);
}
.p-fortune-result__wrap.u-container .p-fortune-result__about-points .about-content {
  font-family: var(--font-family-letter);
  line-height: var(--line-height-text-main);
  color: var(--color-text);
}
.p-fortune-result__wrap.u-container .p-fortune-result__about-points .about-content p {
  margin-bottom: 8px;
}
.p-fortune-result__wrap.u-container .p-fortune-result__about-points .about-content p:last-child {
  margin-bottom: 0;
}
.p-fortune-result__wrap.u-container .p-fortune-result__back .c-btn--back {
  border: 1px solid var(--color-main-pink);
  color: var(--color-main-pink);
  background-color: transparent;
  border-radius: 30px;
  padding: 12px var(--int-m-2);
  font-weight: bold;
  position: relative;
}
.p-fortune-result__wrap.u-container .p-fortune-result__back .c-btn--back::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--color-main-pink);
  border-bottom: 2px solid var(--color-main-pink);
}

/* =========================================
  フォーチュンクッキー アニメーション演出
========================================= */
.p-fortune-result__animation {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: var(--int-m-2);
}

/* ── クッキー2つ ── */
#result-cookie-wrap {
  position: relative;
  width: 300px;
  height: 60px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: -10px;
  z-index: 2;
}

.rc-whole {
  width: 120px;
  height: auto;
  object-fit: contain;
  position: absolute;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.rc-whole.enter {
  animation: rcEnterWhole 0.5s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}
.rc-whole.hide {
  opacity: 0 !important;
}

/* 割れたクッキー半分 */
.rc-half {
  width: 60px;
  height: auto;
  object-fit: contain;
  position: absolute;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#rc-left {
  left: 50%;
  transform: translateX(2px) rotate(-12deg);
  transform-origin: bottom right;
}
#rc-left.open {
  opacity: 1;
  animation: rcOpenLeft 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

#rc-right {
  left: 50%;
  transform: translateX(2px) rotate(12deg);
  transform-origin: bottom left;
}
#rc-right.open {
  opacity: 1;
  animation: rcOpenRight 0.7s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* クッキーのキーフレーム */
@keyframes rcEnterWhole {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.6);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes rcOpenLeft {
  0% {
    transform: translateX(calc(-100% - 2px)) rotate(-12deg);
  }
  100% {
    transform: translateX(calc(-100% - 16px)) rotate(-28deg);
  }
}
@keyframes rcOpenRight {
  0% {
    transform: translateX(2px) rotate(12deg);
  }
  100% {
    transform: translateX(16px) rotate(28deg);
  }
}
/* ── 紙 ── */
#paper-wrap {
  position: relative;
  width: 72px;
  z-index: 1;
}

#paper-wrap-inner {
  overflow: hidden;
  height: 0;
  transition: height 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.paper-scroll {
  width: 100%;
  background: white;
  border-radius: 0 0 8px 8px;
  border-top: 8px solid var(--color-main-pink);
  border-bottom: 8px solid var(--color-main-pink);
  padding: 32px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 8px 32px rgba(180, 120, 80, 0.18);
}

/* 縦書きメッセージ */
.paper-main {
  font-family: var(--font-family-letter);
  font-size: 16px;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.5em;
  line-height: 1.8;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.7s 0.5s;
}
.paper-main .tcy {
  text-combine-upright: all;
}
.paper-main.show {
  opacity: 1;
}

/* ── スパークル ── */
.sparkle {
  position: fixed;
  pointer-events: none;
  font-size: 1.4rem;
  z-index: 31;
  animation: sparkleFly 1.6s ease-out forwards;
  color: var(--color-main-yellow);
}

@keyframes sparkleFly {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-90px) scale(0.3);
  }
}
/* =========================================
  割れたクッキーのレイアウト（.p-fortune 内）
========================================= */
.p-fortune__img-broken {
  justify-content: center;
  align-items: center;
  gap: 16px;
}
.p-fortune__img-broken img {
  width: 48%;
  height: auto;
}
