@charset "utf-8";
/* ============================================
   一枚引き 共通スタイル
   今日の運勢 / 恋愛運 / 仕事運 / イエス・ノー で共用
   ============================================ */

/* ---------- 占い方の囲み ---------- */
.howto-list { display: grid; gap: 14px; margin-top: 26px; }
.howto {
  padding: 20px 22px;
  border: 1px solid rgba(200, 168, 106, 0.25);
  background: rgba(26, 29, 53, 0.4);
}
.howto-title {
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  color: var(--star);
  margin-bottom: 8px;
}
.howto-title::before { content: '\2726  '; color: var(--gold); }
.howto-body { font-size: 0.78rem; line-height: 2; color: rgba(245, 240, 232, 0.75); }

/* ---------- 引きの間 ---------- */
.draw-stage {
  margin-top: 50px;
  text-align: center;
  min-height: 540px;
}
.draw-invite {
  font-family: 'Shippori Mincho B1', serif;
  font-size: 0.88rem;
  letter-spacing: 0.2em;
  color: rgba(232, 212, 154, 0.85);
  margin-bottom: 26px;
}

/* カード(裏⇄表) */
.card-flip {
  width: min(62vw, 250px);
  margin: 0 auto;
  perspective: 1200px;
  -webkit-perspective: 1200px;
  cursor: pointer;
  border: none;
  background: none;
  display: block;
  padding: 0;
  position: relative;
}
/* 高さの確保: 古いブラウザ用の予備(padding比率) → 対応ブラウザはaspect-ratioで上書き */
.card-flip::after {
  content: '';
  display: block;
  padding-bottom: 178.3%; /* 895/502 */
}
@supports (aspect-ratio: 1) {
  .card-flip { aspect-ratio: 502 / 895; }
  .card-flip::after { display: none; }
}
/* 札の背後の暈(月明かり) */
.card-flip::before {
  content: '';
  position: absolute;
  inset: -16% -22%;
  background: radial-gradient(ellipse at center,
    rgba(245, 240, 232, 0.34) 0%,
    rgba(245, 240, 232, 0.16) 42%,
    rgba(245, 240, 232, 0.05) 62%,
    transparent 75%);
  filter: blur(4px);
  pointer-events: none;
}
.card-flip:focus-visible { outline: 2px solid var(--star); outline-offset: 6px; }

/* aspect-ratio 非対応でも padding 比率で確保した高さを満たせるよう絶対配置にする
   (relative + height:100% だと親の高さが auto 扱いになり潰れる) */
.card-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 1.6s cubic-bezier(0.18, 0.75, 0.22, 1);
  -webkit-transition: -webkit-transform 1.6s cubic-bezier(0.18, 0.75, 0.22, 1);
}
/* 一回転半して表が向く */
.card-flip.flipped .card-inner { transform: rotateY(540deg); }

/* ---------- シャッフル(分身札が交差して混ざる) ---------- */
.ghost {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}
.ghost svg { width: 100%; height: 100%; display: block; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.ghost.g2, .ghost.g4 { z-index: 2; } /* 手前を横切る札 */
.shuffling .ghost { opacity: 1; }
.shuffling .ghost.g1 { animation: mixA 1.9s ease-in-out forwards; }
.shuffling .ghost.g2 { animation: mixB 1.9s ease-in-out forwards; }
.shuffling .ghost.g3 { animation: mixC 1.9s ease-in-out forwards; }
.shuffling .ghost.g4 { animation: mixD 1.9s ease-in-out forwards; }
.shuffling .card-inner { animation: mixMain 1.9s ease-in-out; }

@keyframes mixA {
  0%   { transform: none; opacity: 0; }
  12%  { opacity: 1; }
  30%  { transform: translate(-58%, -4%) rotate(-14deg); }
  55%  { transform: translate(38%, 5%) rotate(9deg); }
  80%  { transform: translate(-20%, -2%) rotate(-5deg); }
  100% { transform: none; opacity: 0; }
}
@keyframes mixB {
  0%   { transform: none; opacity: 0; }
  12%  { opacity: 1; }
  30%  { transform: translate(55%, 3%) rotate(13deg); }
  55%  { transform: translate(-40%, -6%) rotate(-10deg); }
  80%  { transform: translate(22%, 3%) rotate(6deg); }
  100% { transform: none; opacity: 0; }
}
@keyframes mixC {
  0%   { transform: none; opacity: 0; }
  15%  { opacity: 1; }
  35%  { transform: translate(-30%, -9%) rotate(-7deg) scale(0.97); }
  60%  { transform: translate(26%, 8%) rotate(11deg) scale(0.97); }
  85%  { transform: translate(-12%, 2%) rotate(-3deg); }
  100% { transform: none; opacity: 0; }
}
@keyframes mixD {
  0%   { transform: none; opacity: 0; }
  15%  { opacity: 1; }
  35%  { transform: translate(32%, -7%) rotate(8deg) scale(0.96); }
  60%  { transform: translate(-28%, 7%) rotate(-12deg) scale(0.96); }
  85%  { transform: translate(14%, -2%) rotate(4deg); }
  100% { transform: none; opacity: 0; }
}
@keyframes mixMain {
  0%   { transform: none; }
  30%  { transform: translate(6%, 2%) rotate(3deg); }
  55%  { transform: translate(-8%, -2%) rotate(-4deg); }
  80%  { transform: translate(4%, 1%) rotate(2deg); }
  100% { transform: none; }
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 8px;
  overflow: hidden;
}
.card-face img, .card-face svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.card-back { animation: breathe 3.4s ease-in-out infinite; box-shadow: 0 14px 44px rgba(0, 0, 0, 0.6); }
.card-flip.flipped .card-back { animation: none; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 14px 44px rgba(0,0,0,0.6), 0 0 24px rgba(200,168,106,0.12); }
  50% { box-shadow: 0 14px 44px rgba(0,0,0,0.6), 0 0 44px rgba(200,168,106,0.3); }
}
.card-front { transform: rotateY(180deg); background: none; }
.card-front img {
  object-fit: contain;
  filter: drop-shadow(0 12px 26px rgba(0, 0, 0, 0.55));
}

/* ---------- 結果 ---------- */
.result {
  margin-top: 36px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s ease 0.5s, transform 1s ease 0.5s;
  visibility: hidden;
}
.result.show { opacity: 1; transform: translateY(0); visibility: visible; }

/* イエス・ノーの答え(他の占いでは使わないので既定で非表示) */
.result-answer {
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 800;
  font-size: clamp(2rem, 8vw, 2.9rem);
  letter-spacing: 0.2em;
  line-height: 1.4;
  color: var(--star);
  text-shadow: 0 0 32px rgba(200, 168, 106, 0.35);
  margin-bottom: 20px;
}
.result-answer[hidden] { display: none; }

.result-name {
  font-family: 'Shippori Mincho B1', serif;
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: 0.25em;
  color: var(--cream);
}
.result-en {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  display: block;
  margin-top: 6px;
}
.result-pos {
  display: inline-block;
  margin-top: 14px;
  padding: 5px 18px;
  border: 1px solid rgba(200, 168, 106, 0.5);
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--star);
}
.result-text {
  margin: 28px auto 0;
  max-width: 480px;
  text-align: left;
  font-size: 0.86rem;
  line-height: 2.4;
  letter-spacing: 0.05em;
  color: rgba(245, 240, 232, 0.9);
  padding: 26px 26px;
  background: rgba(26, 29, 53, 0.55);
  border-top: 1px solid rgba(200, 168, 106, 0.35);
  border-bottom: 1px solid rgba(200, 168, 106, 0.35);
}
.result-text p + p { margin-top: 1em; }

.result-actions {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.result-consult {
  margin-top: 40px;
  font-size: 0.78rem;
  line-height: 2.1;
  color: rgba(245, 240, 232, 0.6);
}
