@charset "UTF-8";

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

:root {
  --bgc: #fff;
  --main: #5b9fbd;
  --white: #fff;
  --accent1: #AA8B2B;
  --accent2: #f0c94d;
  --cinzelfont: "Cinzel", serif;
  --kaiseifont: "Kaisei Tokumin", serif;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: bottom;
}

button {
  font: inherit;
}

h1 {
  font-family: var(--cinzelfont);
  color: var(--accent1);
  font-weight: 700;
}

/* =========================
  curtain
========================= */

.curtain {
  position: absolute;
  top: 0;
  display: block;
  width: clamp(180px, 23vw, 360px);
  height: auto;
  pointer-events: none;
  /* 下の1だと現在カーテンは後ろの状態なので前にしたい場合は3に変更するのを忘れないこと */
  z-index: 1;
}

.curtain-left {
  left: 0;
}

.curtain-right {
  right: 0;
}

@media (max-width: 480px) {
  .curtain {
    display: none;
  }
}

/* カーテンアニメーション(もったいぶるときは1.4sの方がよいかも) */
.is-opening .curtain {
  animation: curtain-up 1.1s ease-in-out forwards;
}

@keyframes curtain-up {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-110%);
  }
}


/* =========================
  ページ共通
========================= */

.main-visual,
.result-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  background-image: url("../images/bg_main.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  position: relative;
  overflow-x: hidden;
}


.main-visual>div {
  width: min(100%, 380px);
  position: relative;
  z-index: 2;
}

.image-credits {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: block;
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: 11px;
  line-height: 1.5;
}

.image-credits a {
  color: rgba(80, 80, 80, 0.7);
}

/* 高さが足りないPCだけ、結果全体を80％にする */
@media screen and (min-width: 768px) and (max-height: 750px) {
  .result-inner {
    zoom: 0.8;
  }
}

/* =========================
  title
========================= */

.top-deco {
  display: block;
  width: 82px;
  margin: 0 auto 18px;
  opacity: 0.9;
}

.title-deco {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 0 0 18px;
  gap: 8px;
}

.title-deco img {
  width: auto;
  height: auto;
}

.title-deco img:first-child {
  justify-self: end;
}

.title-deco img:last-child {
  justify-self: start;
}

.start-title {
  font-size: 60px;
  line-height: 1;
  letter-spacing: 0.08em;
  color: var(--accent1);
  background: linear-gradient(180deg,
      #e7d29a 0%,
      #c7a34a 52%,
      #9f7d28 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 1px rgba(88, 67, 25, 0.16));
}

.sp-text {
  display: none;
}

.pc-text {
  display: inline;
}

.card-wrap {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  z-index: 5;
}

.card-deco {
  position: absolute;
  display: block;
  pointer-events: none;
  z-index: 2;
}

/* デコ：きらきら集 */

/* 左真ん中 */
.deco-left {
  width: 48px;
  left: -150px;
  top: 34%;
}

/* カード左下 */
.deco-bottom-left {
  width: 42px;
  left: -69px;
  bottom: -40px;
}

/* カード右下 */
.deco-bottom-right {
  width: 44px;
  right: -144px;
  bottom: 75px;
}

/* カード左下・白 */
.deco-bottom-white-left {
  width: 42px;
  left: -300px;
  bottom: 70px;
}

/* カード右下・白 */
.deco-bottom-white-right {
  width: 44px;
  right: -240px;
  bottom: 180px;
}



/* =========================
  card
========================= */

.card-button {
  display: block;
  width: min(58vw, 215px);
  margin: 0 auto;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;

  transition:
    transform 0.3s ease,
    filter 0.3s ease;
}

.card-button:hover {
  transform: translateY(-8px) rotate(1.5deg);
  filter: drop-shadow(0 16px 18px rgba(40, 91, 116, 0.28));
}

.card-button:active {
  transform: translateY(-2px) scale(0.98);
}

.card-button:focus-visible,
.map-link:focus-visible,
.retry-button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
}

.card-image {
  display: block;
  width: 100%;
  margin: 32px auto;
  border-radius: 16px;
  box-shadow: 0 18px 32px rgba(40, 91, 116, 0.28);
}

/* =========================
  responsive
========================= */

@media (max-width: 480px) {
  .main-visual {
    padding: 40px 18px 24px;
    flex-direction: column;
  }

  .main-visual>div {
    width: min(100%, 350px);
  }

  .title-deco {
    margin-bottom: 28px;
  }

  .start-title {
    font-size: clamp(44px, 14vw, 60px);
  }

  .card-button {
    width: min(62vw, 200px);
  }

  /* デコ：きらきら集 */
  .deco-left {
    width: 38px;
    left: -60px;
    top: 34%;
  }

  .deco-bottom-left {
    width: 34px;
    left: -32px;
    bottom: -36px;
  }

  .deco-bottom-right {
    width: 36px;
    right: -50px;
    bottom: 50px;
  }

  /* カード左下・白 */
  .deco-bottom-white-left {
    display: none;
  }

  /* カード右下・白 */
  .deco-bottom-white-right {
    width: 24px;
    right: -24px;
    top: -20px;
  }


  .pc-text {
    display: none;
  }

  .sp-text {
    display: inline;
  }
}

/* =========================
  card flip
========================= */

.card-button {
  perspective: 1200px;
}

.card-flip {
  position: relative;
  display: block;
  width: 100%;
  transform-style: preserve-3d;
}

.card-face {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-front {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}

.is-opening .card-flip {
  animation: card-flip-open 0.9s cubic-bezier(0.65, 0, 0.35, 1) 1.05s forwards;
}

@keyframes card-flip-open {
  0% {
    transform: translateY(0) rotateY(0deg);
  }

  20% {
    transform: translateY(-12px) rotateY(0deg);
  }

  100% {
    transform: translateY(0) rotateY(180deg);
  }
}

/* =========================
  card light
========================= */

.card-light {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;

  display: block;
  width: 120px;
  aspect-ratio: 1;
  border-radius: 50%;

  background: radial-gradient(circle,
      rgba(255, 255, 255, 1) 0%,
      rgba(255, 255, 255, 0.98) 20%,
      rgba(246, 252, 255, 0.9) 38%,
      rgba(222, 242, 250, 0.55) 58%,
      rgba(222, 242, 250, 0) 76%);

  opacity: 0;
  filter: blur(5px);
  pointer-events: none;

  transform: translate(-50%, -50%) scale(0.2);
}

.is-opening .card-light {
  animation: card-light-open 0.7s ease-out 1.72s forwards;
}

@keyframes card-light-open {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }

  30% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(2);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(18);
  }
}

@media (max-width: 480px) {
  .is-opening .card-flip {
    animation-delay: 0.15s;
  }

  .is-opening .card-light {
    animation-delay: 0.85s;
  }
}


/* --------------------------------------------------------------------------------------------------------------------- */
/* =========================
  result page
========================= */


.result-inner {
  width: min(100%, 980px);
  min-height: calc(100vh - 112px);
  margin: 0 auto;

  display: grid;
  grid-template-columns: 260px 1fr;
  column-gap: 40px;
}

/* 左側：カード */

.result-left {
  text-align: center;
}

.result-deco {
  display: block;
  width: 74px;
  margin: 0 auto 16px;
}

.result-card-title {
  margin-bottom: 6px;
  font-family: var(--cinzelfont);
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--accent1);
}

.result-underbar {
  display: block;
  width: 120px;
  margin: 0 auto 8px;
}

.result-card-image {
  display: block;
  width: 210px;
  margin: 0 auto;
  perspective: 1200px;
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(40, 91, 116, 0.28);
}

.result-card-flip {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;

  transform-style: preserve-3d;
  transform-origin: center;
}

.result-card-face {
  position: absolute;
  inset: 0;

  display: block;
  width: 100%;
  height: 100%;

  object-fit: cover;
  border-radius: 10px;

  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* 最初に表示される結果カード */
.result-card-front {
  transform: rotateY(0deg);
}

/* 最初は裏側を向いているカード裏面 */
.result-card-back {
  transform: rotateY(180deg);
}

.result-card-flip.is-result-card-flipping {
  animation:
    result-card-one-turn var(--result-card-duration, 2600ms) cubic-bezier(0.65, 0, 0.35, 1) 1;
}

@keyframes result-card-one-turn {
  0% {
    transform: translateY(0) rotateY(0deg);
  }

  20% {
    transform: translateY(-8px) rotateY(0deg);
  }

  100% {
    transform: translateY(0) rotateY(360deg);
  }
}

.result-card-label-wrap {
  position: relative;
  width: 170px;
  margin: 8px auto -8px;
}

.result-card-ribbon {
  display: block;
  width: 100%;
}

.result-card-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--kaiseifont);
  font-size: 12px;
  line-height: 1;
  color: var(--main);
  transform: translateY(-9px);
}

.result-card-name-en {
  font-family: var(--cinzelfont);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--accent1);
}

.result-card-name-ja {
  font-family: var(--kaiseifont);
  font-weight: bold;
  font-size: 18px;
  line-height: 1.5;
  color: var(--main);
}

.result-underbar-bottom {
  margin-bottom: 0;
}

/* 右側：結果 */

.result-right {
  position: relative;
  overflow: hidden;
  padding: 40px 48px;
  background: rgba(45, 165, 215, 0.76);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.result-corner {
  position: absolute;
  z-index: 0;
  display: block;
  width: clamp(48px, 5vw, 72px);
  height: auto;
  pointer-events: none;
}

/* 左上：元画像の向き */
.corner-top-left {
  top: 3%;
  left: 3%;
}

/* 右上：左右反転 */
.corner-top-right {
  top: 3%;
  right: 3%;
  transform: scaleX(-1);
}

/* 左下：上下反転 */
.corner-bottom-left {
  bottom: 3%;
  left: 3%;
  transform: scaleY(-1);
}

/* 右下：上下・左右反転 */
.corner-bottom-right {
  right: 3%;
  bottom: 3%;
  transform: scale(-1, -1);
}

/* 文字やボタンを装飾より前にする */
.result-right> :not(.result-corner) {
  position: relative;
  z-index: 1;
}

.fortune-title,
.lucky-title {
  font-family: var(--cinzelfont);
  font-weight: 700;
  color: var(--accent2);
  text-align: center;
  line-height: 1;
  margin-bottom: 24px;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: 0.06em;
}

.fortune-title {
  margin-top: 24px;
}

.fortune-text {
  font-family: var(--kaiseifont);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: var(--white);
  text-align: left;
  white-space: pre-line;
}

.deco-line {
  padding: 24px 88px;
}

.spot-area {
  display: flex;
  justify-content: center;
  gap: 24px;

  font-family: var(--kaiseifont);
  font-size: 13px;
  color: var(--white);
}

.map-link {
  color: var(--white);
  text-decoration: underline;
}

/* RETRY */

.retry-area {
  margin-top: 32px;
  text-align: center;
}

.retry-button {
  display: inline-grid;
  place-items: center;
  width: clamp(145px, 13vw, 180px);

  font-family: var(--cinzelfont);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: bold;
  letter-spacing: 0.18em;
  color: var(--white);
  text-decoration: none;

  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

/* 画像と文字を同じ場所に重ねる */
.retry-button-image,
.retry-button-text {
  grid-area: 1 / 1;
}

.retry-button-image {
  display: block;
  width: 100%;
  height: auto;
}

.retry-button-text {
  position: relative;
  z-index: 1;
}

.retry-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}



/* デコ：キラキラ */
.deco-result-a {
  width: 38px;
  left: 36%;
  top: 44%;
}

.deco-result-b {
  width: 26px;
  left: 18%;
  bottom: 13%;
}

.deco-result-c {
  width: 44px;
  right: 15%;
  bottom: 15%;
}

.deco-result-d {
  width: 42px;
  left: 30%;
  top: 13%;
}


@media (hover: hover) and (pointer: fine) {
  .retry-button:hover {
    opacity: 0.78;
    transform: translateY(-3px);
  }
}

/* =========================
  result page responsive
========================= */

@media (max-width: 768px) {

  /* ページ全体 */
  .result-page {
    min-height: 100svh;
    padding: 28px 16px 40px;

    display: block;
    text-align: center;
    overflow-x: hidden;
  }

  /* PCの2列を、縦1列に変更 */
  .result-inner {
    width: min(100%, 375px);
    min-height: auto;
    margin: 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;
  }

  /* =========================
    左部分
  ========================= */

  .result-left {
    width: 100%;
  }

  .result-deco {
    width: 58px;
    margin-bottom: 8px;
  }

  .result-card-title {
    margin-bottom: 0px;
    font-size: clamp(28px, 9vw, 36px);
  }

  .result-underbar {
    width: 100px;
    margin-bottom: 12px;
  }

  .result-card-image {
    width: min(58vw, 200px);
    max-width: 100%;
  }

  .result-card-label-wrap {
    width: 150px;
    margin: 12px auto 6px;
  }

  .result-card-label {
    font-size: 11px;
  }

  .result-card-name-en {
    margin-top: 6px;
    font-size: 18px;
  }

  .result-card-name-ja {
    margin-top: 3px;
    font-size: 16px;
  }

  .result-underbar-bottom {
    width: 96px;
    margin-top: 8px;
  }

  /* =========================
    右部分
  ========================= */

  .result-right {
    width: 100%;
    margin-top: 26px;
    padding: 32px 24px;
    border-radius: 10px;
  }

  .result-corner {
    width: 48px;
  }

  .corner-top-left {
    top: 3%;
    left: 3%;
  }

  .corner-top-right {
    top: 3%;
    right: 3%;
  }

  .corner-bottom-left {
    bottom: 3%;
    left: 3%;
  }

  .corner-bottom-right {
    right: 3%;
    bottom: 3%;
  }

  .fortune-title {
    margin-bottom: 20px;
    font-size: 20px;
    line-height: 1.15;
  }

  .fortune-text {
    font-size: 13px;
    line-height: 1.9;
    letter-spacing: 0.02em;
  }

  .deco-line {
    padding: 16px 24px;
  }

  .lucky-title {
    margin-top: 8px;
    margin-bottom: 14px;
    font-size: 20px;
  }

  .spot-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;

    font-size: 12px;
  }

  .map-link {
    display: inline-block;
  }

  .deco-result-a {
    top: 40%;
    left: 30%;
  }

  .deco-result-d {
    left: 12%;
    top: 8%;
  }

  /* =========================
    RETRY
  ========================= */

  .retry-area {
    margin-top: 24px;
  }

  .retry-button {
    width: min(48vw, 160px);
    font-size: 18px;
  }
}

/* 星のランダム横回転 */
.random-spin {
  transform-origin: center;
  will-change: transform;
}

.random-spin.is-spinning {
  animation:
    decoration-horizontal-spin var(--spin-duration, 1400ms) cubic-bezier(0.65, 0, 0.35, 1) 1;
}

@keyframes decoration-horizontal-spin {
  0% {
    transform: perspective(600px) rotateY(0deg);
  }

  20% {
    transform: perspective(600px) translateY(-2px) rotateY(0deg);
  }

  100% {
    transform: perspective(600px) translateY(0) rotateY(360deg);
  }
}

.site-footer {
  padding: 24px 16px;
  text-align: center;
}

.image-credits {
  display: block;
  font-size: 12px;
  line-height: 1.7;
}

.image-credits a {
  color: #777;
  text-decoration: none;
}

.image-credits a:hover {
  text-decoration: underline;
}

@media screen and (max-width: 767px) {
  .image-credits {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;

    width: 100%;
    margin: 12px 0 -16px;
    text-align: center;
    font-size: 10px;
    line-height: 1.5;
  }
}