/* ===================================
   タロット片思い占い v2 - 本格タロット体験
   =================================== */

/* ── シャッフルエリア ── */
.tarot-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: 400px;
  margin: 0 auto 20px;
  overflow: hidden;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 40%, #2a1850 0%, #0f0a1e 100%);
  box-shadow: inset 0 0 60px rgba(80,40,160,.3);
}

.tarot-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='40' height='40' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='20' cy='20' r='.5' fill='%23fff' opacity='.15'/%3E%3C/svg%3E");
  pointer-events: none;
}

/* ── カード共通 ── */
.t-card {
  position: absolute;
  width: 70px;
  height: 110px;
  cursor: pointer;
  transition: filter .2s;
  transform-style: preserve-3d;
  z-index: 1;
}

.t-card:hover { z-index: 50; filter: brightness(1.15); }

.t-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .8s cubic-bezier(.4,.0,.2,1);
}

.t-card.flipped .t-card__inner {
  transform: rotateY(180deg);
}

.t-card__back,
.t-card__face {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  backface-visibility: hidden;
  overflow: hidden;
}

/* カード裏面 */
.t-card__back {
  background: linear-gradient(135deg, #2c1a6e, #4a2d9e);
  border: 2px solid #7b5fc0;
  box-shadow: 0 2px 12px rgba(0,0,0,.5);
}

.t-card__back::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255,215,0,.3);
  border-radius: 5px;
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,215,0,.06) 0deg 30deg, transparent 30deg 60deg);
}

.t-card__back::after {
  content: '✦';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: rgba(255,215,0,.4);
  text-shadow: 0 0 10px rgba(255,215,0,.3);
}

/* カード表面 */
.t-card__face {
  transform: rotateY(180deg);
  border: 2px solid #c9a84c;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fffef5;
}

.t-card__face-header {
  width: 100%;
  padding: 3px 0 2px;
  text-align: center;
  font-size: 7px;
  font-weight: 700;
  color: #8b7040;
  letter-spacing: .05em;
  background: linear-gradient(180deg, #f5ecd0, #ede2c0);
  border-bottom: 1px solid #d4c490;
}

.t-card__face-art {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  line-height: 1;
  position: relative;
  overflow: hidden;
}

.t-card__face-art::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .06;
  background: repeating-linear-gradient(45deg, #8b7040 0, #8b7040 1px, transparent 1px, transparent 8px);
}

.t-card__face-footer {
  width: 100%;
  padding: 2px 0 3px;
  text-align: center;
  font-size: 7px;
  font-weight: 700;
  color: #8b7040;
  background: linear-gradient(0deg, #f5ecd0, #ede2c0);
  border-top: 1px solid #d4c490;
}

.t-card__face-num {
  display: block;
  font-size: 6px;
  color: #b0a070;
  margin-top: 1px;
}

/* ── シャッフル中カードアニメ ── */
.t-card.shuffling {
  animation: tarotOrbit var(--orbit-duration, 3s) linear infinite;
  animation-delay: var(--orbit-delay, 0s);
}

@keyframes tarotOrbit {
  from { transform: rotate(var(--orbit-start, 0deg)) translateX(var(--orbit-r, 80px)) rotate(calc(-1 * var(--orbit-start, 0deg))); }
  to   { transform: rotate(calc(var(--orbit-start, 0deg) + 360deg)) translateX(var(--orbit-r, 80px)) rotate(calc(-1 * var(--orbit-start, 0deg) - 360deg)); }
}

/* ── 扇形展開 ── */
.t-card.fanned {
  transition: all .8s cubic-bezier(.34,1.56,.64,1);
  cursor: pointer;
}

.t-card.fanned:hover {
  transform: var(--fan-transform) translateY(-18px) !important;
  z-index: 50;
}

.t-card.fanned.selected {
  z-index: 100;
  filter: brightness(1.2) drop-shadow(0 0 15px rgba(255,215,0,.6));
}

/* ── 選択カード中央表示 ── */
.t-card.revealing {
  transition: all .6s cubic-bezier(.34,1.56,.64,1);
  z-index: 200;
}

/* ── フェーズ切り替え ── */
.tarot-phase { display: none; }
.tarot-phase.active { display: block; animation: fadeUp .5s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── ボタン ── */
.tarot-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 16px auto 0;
  padding: 16px 24px;
  background: linear-gradient(135deg, #534AB7, #7F77DD);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all .25s;
  letter-spacing: .04em;
  position: relative;
  overflow: hidden;
}

.tarot-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  transform: translateX(-100%);
  animation: btnShine 3s ease-in-out infinite;
}

@keyframes btnShine {
  0%, 70% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.tarot-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(83,74,183,.4);
}

.tarot-btn:disabled {
  opacity: .5;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.tarot-btn--gold {
  background: linear-gradient(135deg, #b8860b, #daa520, #f0c040);
  color: #2a1850;
}

.tarot-btn--secondary {
  background: rgba(255,255,255,.08);
  color: #6b60b0;
  border: 1px solid #e0ddf8;
  max-width: 200px;
}

.tarot-btn--secondary::after { display: none; }

/* ── メッセージ ── */
.tarot-msg {
  text-align: center;
  font-size: 14px;
  color: #6b60b0;
  line-height: 1.8;
  margin: 12px 0;
}

.tarot-msg--glow {
  color: #ddd;
  text-shadow: 0 0 12px rgba(200,180,255,.5);
  font-size: 13px;
}

/* ── フォーカスステップ ── */
.tarot-focus-icon {
  text-align: center;
  font-size: 60px;
  display: block;
  margin-bottom: 14px;
  animation: tarotPulse 2.5s ease-in-out infinite;
}

@keyframes tarotPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.tarot-focus-input {
  margin-bottom: 20px;
}

.tarot-focus-input label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #7F77DD;
  margin-bottom: 8px;
}

.tarot-focus-input textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #e0ddf8;
  border-radius: 14px;
  background: #f9f8ff;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  color: #1a1440;
  resize: none;
  transition: border-color .3s;
  line-height: 1.6;
}

.tarot-focus-input textarea:focus {
  outline: none;
  border-color: #7F77DD;
  background: #fff;
}

.tarot-focus-input textarea::placeholder { color: #bbb; }

/* ── 結果：カード大表示 ── */
.tarot-reveal-card {
  width: 180px;
  height: 290px;
  margin: 0 auto 20px;
  perspective: 800px;
}

.tarot-reveal-card .t-card__inner {
  width: 100%;
  height: 100%;
}

.tarot-reveal-card .t-card__face-header,
.tarot-reveal-card .t-card__face-footer {
  font-size: 11px;
  padding: 6px 0;
}

.tarot-reveal-card .t-card__face-num {
  font-size: 9px;
}

.tarot-reveal-card .t-card__face-art {
  font-size: 72px;
}

.tarot-reveal-card .t-card__back::after {
  font-size: 42px;
}

.tarot-reveal-card.revealed .t-card__inner {
  animation: cardReveal 1.2s cubic-bezier(.4,.0,.2,1) forwards;
}

@keyframes cardReveal {
  0%   { transform: rotateY(0) scale(1); }
  40%  { transform: rotateY(90deg) scale(1.1); }
  60%  { transform: rotateY(90deg) scale(1.1); }
  100% { transform: rotateY(180deg) scale(1); }
}

.tarot-position-badge {
  text-align: center;
  margin: 10px 0 16px;
}

.tarot-position-badge span {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
}

.tarot-position-badge .upright {
  background: linear-gradient(135deg, #eeedfe, #f3f0ff);
  color: #534AB7;
  border: 1px solid #AFA9EC;
}

.tarot-position-badge .reversed {
  background: linear-gradient(135deg, #fff0f0, #fee);
  color: #c0392b;
  border: 1px solid #f0a0a0;
}

/* ── 結果カード ── */
.tarot-result-card {
  margin-bottom: 20px;
}

.tarot-keywords {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0;
}

.tarot-kw {
  background: #eeedfe;
  color: #534AB7;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 20px;
  font-weight: 500;
  border: 1px solid #ddd9f8;
}

/* ── 結果タイトル・サマリー ── */
.tarot-result-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #2d2360;
  margin: 12px 0 8px;
  line-height: 1.4;
}

.tarot-summary-badge {
  text-align: center;
  margin: 0 0 16px;
}

.tarot-summary-text {
  display: inline-block;
  background: linear-gradient(135deg, #6C63FF 0%, #a18cd1 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 20px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

/* ── スコア ── */
.tarot-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.tarot-score-item {
  background: #f9f8ff;
  border-radius: 12px;
  padding: 14px;
}

.tarot-score-label {
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
}

.tarot-score-bar {
  background: #e0ddf8;
  border-radius: 4px;
  height: 7px;
  margin-bottom: 6px;
  overflow: hidden;
}

.tarot-score-fill {
  height: 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, #7F77DD, #AFA9EC);
  transition: width 1.2s ease;
}

.tarot-score-val {
  font-size: 20px;
  font-weight: 700;
  color: #534AB7;
}

.tarot-score-unit {
  font-size: 12px;
  font-weight: 400;
  color: #aaa;
}

/* ── セクションタイトル ── */
.tarot-sec-ttl {
  font-size: 13px;
  font-weight: 700;
  color: #7F77DD;
  margin: 22px 0 10px;
  padding-left: 10px;
  border-left: 3px solid #7F77DD;
  letter-spacing: .06em;
}

.tarot-reading {
  font-size: 14px;
  color: #333;
  line-height: 2;
}

/* ── アドバイスグリッド ── */
.tarot-advice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.tarot-advice-box {
  background: #f9f8ff;
  border-radius: 10px;
  padding: 12px;
}

.tarot-advice-key {
  font-size: 10px;
  color: #aaa;
  margin-bottom: 4px;
  letter-spacing: .04em;
}

.tarot-advice-val {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  color: #333;
}

/* ── アクション ── */
.tarot-action {
  background: linear-gradient(135deg, #f3f0ff, #eeedfe);
  border-radius: 14px;
  padding: 18px 20px;
  margin-top: 18px;
  border-left: 4px solid #7F77DD;
}

.tarot-action-ttl {
  font-size: 12px;
  font-weight: 700;
  color: #7F77DD;
  margin-bottom: 8px;
  letter-spacing: .06em;
}

.tarot-action-text {
  font-size: 14px;
  color: #333;
  line-height: 1.9;
}

/* ── タイミング ── */
.tarot-timing {
  background: #fff8f0;
  border-radius: 14px;
  padding: 18px 20px;
  margin-top: 14px;
  border-left: 4px solid #f5a623;
}

.tarot-timing-ttl {
  font-size: 12px;
  font-weight: 700;
  color: #e8950a;
  margin-bottom: 8px;
}

.tarot-timing-text {
  font-size: 14px;
  color: #333;
  line-height: 1.9;
}

/* ── ラッキーアイテム ── */
.tarot-lucky {
  background: #eeedfe;
  border-radius: 12px;
  padding: 16px;
  margin-top: 18px;
}

.tarot-lucky-ttl {
  font-size: 12px;
  font-weight: 700;
  color: #534AB7;
  margin-bottom: 10px;
}

.tarot-lucky-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tarot-lucky-tag {
  background: #fff;
  color: #534AB7;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid #c4c0ee;
  font-weight: 500;
}

/* ── アコーディオン ── */
.tarot-accordion {
  margin-top: 20px;
}

.tarot-accordion-btn {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: #f9f8ff;
  border: 1.5px solid #e0ddf8;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #534AB7;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all .25s;
  text-align: center;
  letter-spacing: .03em;
}

.tarot-accordion-btn:hover {
  background: #eeedfe;
  border-color: #AFA9EC;
}

.tarot-accordion-body {
  overflow: hidden;
  transition: max-height .5s ease;
}

.tarot-detail-section {
  padding: 20px 0 4px;
}

.tarot-detail-ttl {
  font-size: 14px;
  font-weight: 700;
  color: #534AB7;
  margin: 16px 0 8px;
  padding-left: 10px;
  border-left: 3px solid #AFA9EC;
}

.tarot-detail-ttl:first-child {
  margin-top: 0;
}

.tarot-detail-text {
  font-size: 13px;
  color: #555;
  line-height: 1.9;
  margin: 0 0 4px;
}

/* ── レスポンシブ ── */
@media (max-width: 480px) {
  .tarot-stage { height: 340px; }
  .t-card { width: 54px; height: 86px; }
  .t-card__back::after { font-size: 16px; }
  .t-card__face-art { font-size: 28px; }
  .t-card__face-header,
  .t-card__face-footer { font-size: 5.5px; padding: 2px 0; }
  .tarot-reveal-card { width: 150px; height: 240px; }
  .tarot-reveal-card .t-card__face-art { font-size: 56px; }
  .tarot-scores { grid-template-columns: 1fr; }
  .tarot-advice-grid { grid-template-columns: 1fr; }
}
