/* 復縁占い専用のデザイン。ほかのテーマには影響しません。 */
:root {
  /* 復縁占いのテーマカラー */
  --accent: #c9a504;
  --accent-soft: #f3dfb4;
  --bg-top: #000000;
  --bg-bottom: #131013;
  --text: #FFF;
  --text-dim: #FFF;
  --panel: rgba(255, 255, 255, 0.07);
  --line: #666239;
  --serif: "Shippori Mincho", serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Shippori Mincho", serif;
  line-height: 1.8;
  background-color: #000;
}

/* 背景画像は body::before に敷いて画面に固定する。
   iPhone（iOS の Safari）では background-attachment: fixed が効かないため、この方法にしている */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100vh;
  height: 100lvh; /* アドレスバーが隠れたときも下にすき間ができないよう、画面の最大の高さに合わせる */
  background-image: url(../fukuen/img/body-bg.jpg);
  background-repeat: no-repeat;
  background-size: 100%;
  background-position: center;
  pointer-events: none;
}

@media screen and (max-width: 600px){
  body::before{
    background-size: 100% 100%;
  }
}

[hidden] { display: none !important; }

/* リンクは白＋下線（ページ内のすべてのリンクに共通） */
a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
a:hover, a:focus-visible { color: var(--accent-soft); }

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.7;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 28% 62%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 46% 30%, var(--accent-soft), transparent),
    radial-gradient(1px 1px at 63% 78%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 78% 14%, #fff, transparent),
    radial-gradient(1px 1px at 90% 48%, var(--accent-soft), transparent),
    radial-gradient(1px 1px at 8% 86%, #fff, transparent),
    radial-gradient(1px 1px at 54% 92%, #fff, transparent);
  animation: twinkle 5s ease-in-out infinite alternate;
}

@keyframes twinkle { from { opacity: 0.35; } to { opacity: 0.8; } }

.wrap {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 16px 64px;
}

.wrap img{
  max-width: 100%;
}

/* ---------- 広告を含むことの表示 ---------- */
.pr-note { padding: 5px; font-size: 0.7rem; text-align: center; color: var(--text); opacity: 0.85; }

/* ---------- ヘッダー ---------- */
/* hero は画像（hero-img.jpg）1枚で見せる。高さは画像に合わせて自動で決まる */
.hero {
  margin-bottom: 28px;
}

/* hero の画像は枠の幅に合わせて縮める（指定しないと元の大きさ 941px のままはみ出す） */
.hero img { display: block; width: 100%; height: auto; }

/* カードのシャッフル中と結果の画面では、ヘッダー（イラストと見出し）を出さない */
body[data-view="loadingView"] .hero,
body[data-view="resultView"] .hero { display: none; }

/* 見出しまわりの文字をひとまとめにして、上下が透明に溶ける黒のグラデーションを敷く */
.hero-text {
  margin-bottom: 2rem; /* 下端からの浮かせ具合（大きくするほど上へ） */
  padding: 5rem 2rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.85) 35%, rgba(0, 0, 0, 0.85) 85%, rgba(0, 0, 0, 0) 100%);
}
.hero-sub { margin: 0 0 6px; color: var(--accent); font-size: 1.3rem; letter-spacing: 0.12em; }
.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 6.5vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.4;
}
.hero-desc { margin: 12px 0 0; color: var(--text-dim); font-size: 1rem; }

@media screen and (max-width: 600px){
  .hero-text{
    margin-bottom: 0;
    padding: 5rem 2rem 3rem 2rem;
  }
  .hero h1{
    font-size: 7vw;
  }
}

/* ---------- パネル ---------- */
.panel {
  padding: 24px 20px;
  border-radius: 6px;
  background: var(--panel);
  backdrop-filter: blur(6px);
}

/* ---------- ブログ記事の一覧（入力フォームの下） ---------- */
.articles { margin-top: 40px; }
.article-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; margin: 0 0 20px; padding: 0; list-style: none; }
.article-card { display: block; color: var(--text); text-decoration: none; }
.article-card:hover .article-title, .article-card:focus-visible .article-title { color: var(--accent-soft); text-decoration: underline; }
.article-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; }
.article-title {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  font-size: 0.85rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; /* タイトルは3行まで。あふれた分は「…」にする */
}
.article-more { margin: 0; text-align: center; font-size: 0.9rem; }

/* ---------- この占いでわかること・使い方 ---------- */
.guide { margin-bottom: 16px; }
.guide-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-soft);
}
.guide-title::before { content: "✦ "; color: var(--accent); }

.mark-title {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-soft);
  text-align: center;
  line-height: 1.4em;
}

/* 見出しの上・中央にアイコン（mark-ttl_icon.png）を表示する。結果の見出し（.result-title）にも同じアイコンを付ける */
.mark-title::before,
.result-title::before {
  content: "";
  display: block;
  width: 160px;
  aspect-ratio: 600 / 504;
  margin: 0 auto -16px;
  background: url(img/mark-ttl_icon.png) center / contain no-repeat;
}


.guide-list, .guide-steps { margin: 0 0 24px; padding: 0; list-style: none; }
.guide-list li, .guide-steps li {
  padding: 10px 0;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-dim);
  border-bottom: 1px solid var(--line);
}
.guide-list li:last-child, .guide-steps li:last-child { border-bottom: 0; }
.guide-list strong { display: block; font-size: 0.95rem; font-weight: 400; color: var(--text); }
.guide-steps { counter-reset: step; }
.guide-steps li { position: relative; padding-left: 2.4em; counter-increment: step; }
.guide-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 10px;
  width: 1.7em;
  height: 1.7em;
  line-height: 1.7em;
  text-align: center;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 50%;
}
.guide-steps strong { font-weight: 400; color: var(--text); }
.guide-note { margin: 0; font-size: 1rem; color: var(--text-dim); }

fieldset { margin: 0 0 20px; padding: 0; border: 0; }
legend {
  padding: 0;
  margin-bottom: 10px;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--accent-soft);
}
legend::before { content: "✦ "; color: var(--accent); }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; margin-bottom: 4px; font-size: 0.82rem; color: var(--text-dim); }
.field small { font-size: 0.75rem; }

input[type="text"], select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px; /* iOS のズーム防止 */
  color: var(--text);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: 10px;
  appearance: none;
}
input::placeholder { color: rgba(255, 255, 255, 0.3); }
input:focus-visible, select:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
select option { color: #222; }

.birthday { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.note { margin: 0 0 16px; font-size: 0.78rem; color: var(--text-dim); }
.hukidashi{
  margin: 0 0 5px 0;
  font-size: 0.8em;
  color: var(--accent);
  text-align: center;
}
.error { margin: 0 0 16px; padding: 10px 12px; font-size: 0.85rem; color: #ffd9d9; background: rgba(200, 60, 80, 0.25); border-radius: 10px; }

.btn {
  display: block;
  width: 100%;
  padding: 15px;
  font: inherit;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #2a1a10;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-ghost { color: var(--text); background: transparent; border: 1px solid var(--line); font-size: 0.92rem; }

/* ---------- シェアボタン ---------- */
.share { margin: 24px 0 16px; }
.share-title { margin: 0 0 10px; font-size: 0.85rem; color: var(--text-dim); }
.share-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.share-btn {
  flex: 1 1 0;
  min-width: 90px;
  padding: 11px 8px;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.share-btn:hover, .share-btn:focus-visible { color: var(--text); border-color: var(--accent); }
.share-done { margin: 10px 0 0; font-size: 0.8rem; color: var(--accent-soft); }

/* ---------- カードをめくる画面 ---------- */
.loading { text-align: center; padding: 48px 20px; color: var(--text-dim); }
.draw-card {
  position: relative;
  display: block;
  width: min(58vw, 220px);
  aspect-ratio: 12 / 22;
  margin: 0 auto 28px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: card-float 3.2s ease-in-out infinite; /* 上下にゆっくり動く */
}
.draw-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.draw-card.is-waiting { cursor: default; opacity: 0.75; }
@keyframes card-float {
  0%, 100% { transform: translateY(-8px); }
  50% { transform: translateY(8px); }
}
.draw-hint { margin: 0; font-family: var(--serif); font-size: 1rem; letter-spacing: 0.1em; color: var(--accent-soft); animation: hint-blink 2s ease-in-out infinite; }
@keyframes hint-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---------- 結果 ---------- */
.result { text-align: center; }
.result-date { margin: 0; font-family: var(--serif); color: var(--accent); letter-spacing: 0.1em; font-size: 1.5em; }
.result-names { margin: 2px 0 20px; font-size: 0.88rem; color: var(--text-dim); }

.card-stage { perspective: 1200px; display: flex; justify-content: center; margin-bottom: 16px; }
.card {
  position: relative;
  width: min(58vw, 220px);
  aspect-ratio: 12 / 22;
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.3, 0.8, 0.3, 1);
}
.card.is-open { transform: rotateY(180deg); }
.card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid var(--accent);
  backface-visibility: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.card-back {
  background:
    url("../../img/tarot/back.jpg") center / cover no-repeat,
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 6px, transparent 6px 12px),
    linear-gradient(135deg, var(--bg-bottom), var(--bg-top));
}
.card-front { transform: rotateY(180deg); background: #1a1226; }
.card-front img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 逆位置は絵柄を上下逆さまにする（画像は正位置の1種類だけ用意すればOK） */
.card-front.is-reversed img,
.card-front.is-reversed .card-placeholder { transform: rotate(180deg); }

.card-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-family: var(--serif);
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.14), transparent 65%), linear-gradient(160deg, var(--bg-bottom), var(--bg-top));
}
.card-front.no-image img { display: none; }
.card-front.no-image .card-placeholder { display: flex; }
.ph-number { color: var(--accent); font-size: 1.1rem; letter-spacing: 0.15em; }
.ph-name { font-size: 1.5rem; }
.ph-en { font-size: 0.7rem; color: var(--text-dim); letter-spacing: 0.12em; }

.card-name { margin: 0 0 21px; font-family: var(--serif); font-size: 2rem; line-height: 1.4em; }
.orientation {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 30px;
  font-size: 0.8rem;
  color: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  vertical-align: middle;
  line-height: 2.4em;
}

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 24px; padding: 0; list-style: none; }
.chips li { padding: 2px 12px; font-size: 0.8rem; color: #000000; background: #FFF; border-radius: 999px; }

.result-title {
  margin: 0 0 16px;
  padding-bottom: 14px;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4.8vw, 1.4rem);
  font-weight: 600;
  line-height: 1.6;
  color: var(--accent-soft);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.result-text { text-align: left; font-size: 0.97rem; line-height: 2; }
.result-text p { margin: 0 0 1em; }
.result-section + .result-section { margin-top: 28px; }
.result-section h3 {
  margin: 0 0 10px;
  padding-left: 12px;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--accent-soft);
  border-left: 3px solid var(--accent);
}
.result-section p:last-child { margin-bottom: 0; }

/* 運命が動く時期・ラッキーナンバー・ラッキーアイテム（縦に3つ並べる） */
.info-list { display: flex; flex-direction: column; gap: 10px; margin: 24px 0 16px; }
.info-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
}
.info-box-main { border-color: var(--accent); }
.info-icon { display: block; width: 56px; height: 56px; margin-bottom: 6px; object-fit: contain; }
.destiny-value { font-family: var(--serif); font-size: 1.3rem; line-height: 1.5; color: var(--accent-soft); }
.destiny-note { font-size: 0.75rem; color: var(--text-dim); }
.lucky-label { font-size: 0.72rem; color: var(--accent); letter-spacing: 0.05em; }
.lucky-value { font-family: var(--serif); font-size: 1.05rem; line-height: 1.5; }
.lucky-number { font-size: 1.8rem; line-height: 1.2; }

/* 星座の表示。上に今日の星座、下に自分 × 相手を横並び */
.signs { display: flex; flex-direction: column; align-items: center; gap: 18px; margin: 0 0 24px; }
/* 1人ぶん：名前 → 星座アイコン → 星座名 の縦並び */
.sign-person { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.sign-label { font-size: 1rem; color: var(--text-dim); overflow-wrap: anywhere; }
.sign-icon { display: block; width: 90px; height: 90px; object-fit: contain; }
.sign-name { font-family: var(--serif); font-size: 0.95rem; }
.sign-pair { display: flex; align-items: center; justify-content: center; gap: 0; width: 100%; }
.sign-pair .sign-person { flex: 0 1 40%; }
.sign-cross { font-size: 1.3rem; line-height: 1; color: var(--accent); }
.sign-cross-icon { display: block; width: 40px; height: 40px; object-fit: contain; }

.fade-in { animation: fadeIn 0.6s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.footer { margin-top: 24px; text-align: center; font-size: 0.72rem; color: var(--text-dim); }
.footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin: 16px 0 8px; }
.copyright { letter-spacing: 0.05em; }

/* ---------- 利用規約ページ ---------- */
.terms h1 { margin: 0 0 6px; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; text-align: center; color: var(--accent-soft); }
.terms-date { margin: 0 0 24px; font-size: 0.78rem; text-align: center; color: var(--text-dim); }
.terms h2 { margin: 28px 0 8px; padding-left: 12px; font-family: var(--serif); font-size: 1.02rem; font-weight: 600; color: var(--accent-soft); border-left: 3px solid var(--accent); }
.terms p, .terms li { font-size: 0.88rem; line-height: 1.9; }
.terms p { margin: 0 0 0.8em; }
.terms ol, .terms ul { margin: 0 0 0.8em; padding-left: 1.5em; }
.terms-back { margin-top: 28px; text-align: center; }

/* ---------- タロットカードの意味・解説ページ（cards.php・card.php）と、トップページからのリンク ---------- */
.tarot-link { margin: 40px 0 0; text-align: center; }
.tarot-link a {
  display: inline-block;
  padding: 12px 28px;
  font-family: var(--serif);
  letter-spacing: 0.08em;
  color: var(--accent-soft);
  text-decoration: none;
  border: 1px solid var(--accent);
  border-radius: 999px;
}
.tarot-link a::after { content: " ›"; }
.tarot-link a:hover, .tarot-link a:focus-visible { background: rgba(255, 255, 255, 0.08); }

.tarot-page p { margin: 0 0 1em; font-size: 0.95rem; line-height: 1.9; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; font-size: 0.75rem; color: var(--text-dim); }
.tarot-h1 { margin: 0 0 20px; font-family: var(--serif); font-size: 1.6rem; font-weight: 600; line-height: 1.5; text-align: center; color: var(--accent-soft); }
.tarot-h1 small { display: block; font-size: 0.9rem; font-weight: 400; letter-spacing: 0.2em; color: var(--accent); }
.tarot-h1 span { display: block; font-size: 0.85rem; font-weight: 400; letter-spacing: 0.12em; color: var(--text-dim); }

/* 一覧：カードの絵柄を2列に並べる */
.tarot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 16px; margin: 28px 0; padding: 0; list-style: none; }
.tarot-thumb { display: block; text-align: center; color: var(--text); text-decoration: none; }
.tarot-thumb img { display: block; width: 100%; height: auto; border: 1px solid var(--accent); border-radius: 10px; }
.tarot-thumb-number { display: block; margin-top: 10px; font-size: 0.75rem; letter-spacing: 0.2em; color: var(--accent); }
.tarot-thumb-name { display: block; font-family: var(--serif); font-size: 1.05rem; }
.tarot-thumb-en { display: block; font-size: 0.7rem; letter-spacing: 0.08em; color: var(--text-dim); }
.tarot-thumb:hover .tarot-thumb-name, .tarot-thumb:focus-visible .tarot-thumb-name { color: var(--accent-soft); text-decoration: underline; }

/* 各カードのページ */
.tarot-hero-img { display: block; width: min(60%, 260px); height: auto; margin: 0 auto 28px; border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
.tarot-section { margin-top: 36px; }
.tarot-section h2 { margin: 0 0 14px; padding-bottom: 10px; font-family: var(--serif); font-size: 1.2rem; font-weight: 600; line-height: 1.6; color: var(--accent-soft); border-bottom: 1px solid var(--line); }
.tarot-section h3 { margin: 0 0 6px; font-family: var(--serif); font-size: 1rem; font-weight: 600; line-height: 1.7; }
.tarot-pos, .tarot-topic { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0, 0, 0, 0.2); }
.tarot-pos p { margin: 0; }
.tarot-badge { display: inline-block; margin-right: 8px; padding: 1px 10px; font-size: 0.75rem; font-weight: 400; color: var(--accent-soft); border: 1px solid var(--accent); border-radius: 999px; vertical-align: middle; }
.tarot-badge-rev { color: var(--text-dim); border-color: var(--line); }
.tarot-topic dl { margin: 0; }
.tarot-topic dt { margin-top: 10px; }
.tarot-topic dd { margin: 4px 0 0; font-size: 0.92rem; line-height: 1.9; }
.tarot-note { margin-top: 16px !important; font-size: 0.75rem !important; color: var(--text-dim); }
.tarot-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 36px 0 0; font-size: 0.85rem; }
.tarot-cta { margin: 28px 0 0 !important; }
.tarot-cta .btn { text-align: center; text-decoration: none; }
