:root {
  --color-sky-top: #171b3a;
  --color-sky-mid: #2c3468;
  --color-sky-bottom: #4a4f8f;
  --color-gold: #e8c988;
  --color-gold-bright: #f5dfa8;
  --color-ivory: #e9e6f2;
  --color-cream: #f3ede0;
  --color-ink: #1c1a16;
  --color-button-deep: #3a1f3d;
  --color-button-light: #6b3b5c;
  --font-display: "Zen Old Mincho", serif;
  --font-body: "Noto Sans JP", sans-serif;
  --header-h: 56px;
}

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

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

body {
  font-family: var(--font-body);
  color: var(--color-ivory);
  background: #12142a;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  position: relative;
  overflow: clip;
  min-height: 100svh;
  background: var(--color-cream);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- FV ---------- */

.fv {
  position: relative;
}

.fv__bg {
  display: block;
  width: 100%;
  height: auto;
}

.fv__content {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: 8% 8% 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fv__eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--color-gold);
  margin-bottom: 0.5rem;
}

.fv__title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  background: linear-gradient(180deg, var(--color-gold-bright) 0%, var(--color-gold) 60%, #c9a465 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--color-gold);
  margin-bottom: 1rem;
}

.fv__lead {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--color-ivory);
  margin-bottom: 1.4rem;
}

.fv__subheading {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
}

.fv__button {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  display: inline-block;
  transition: transform 0.15s ease;
}

.fv__button:active {
  transform: scale(0.97);
}

.fv__button:disabled {
  opacity: 0.6;
  cursor: default;
}

.fv__button-img {
  display: block;
  width: 78vw;
  max-width: 300px;
  height: auto;
}

.fv__disclaimer {
  margin-top: 1.2rem;
  font-size: 0.7rem;
  line-height: 1.8;
  color: rgba(233, 230, 242, 0.75);
}

/* ---------- テーマ別セクション(準備中) ---------- */

.themes {
  background: var(--color-cream);
  color: var(--color-ink);
  text-align: center;
  padding: 3rem 8% 4rem;
}

/* .themes__heading {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2rem;
} */

/* .themes__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.6rem 1.2rem;
} */

.themes__item {
  position: relative;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: rgba(28, 26, 22, 0.35);
}

.themes__badge {
  display: block;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(28, 26, 22, 0.45);
  margin-top: 0.3rem;
}

/* ---------- ローディング演出 ---------- */

.loading {
  position: fixed;
  inset: 0;
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: rgba(23, 27, 58, 0.92);
  color: var(--color-gold-bright);
  display: none;
}

.loading:not([hidden]) {
  display: flex;
}

.loading__card {
  width: 56px;
  height: 84px;
  border-radius: 6px;
  border: 2px solid var(--color-gold);
  background: linear-gradient(160deg, var(--color-button-light), var(--color-button-deep));
  animation: card-flip 1.1s ease-in-out infinite;
}

.loading__text {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

@keyframes card-flip {
  0%, 100% { transform: rotateY(0deg); }
  50% { transform: rotateY(180deg); }
}

@media (prefers-reduced-motion: reduce) {
  .loading__card {
    animation: none;
  }
  .fv__button {
    transition: none;
  }
}

/* ---------- フッター部 ---------- */
.result-back {
  display: block;
  text-align: center;
  margin-top: 0.6rem;
  padding: 1rem;
  color: var(--color-sky-mid);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.site-footer {
  text-align: center;
  /* padding: 1.5rem 8% 2.5rem; */
  font-size: 0.72rem;
  color: #292929;
}

/* トップページのフッター（.app の直下にあるもの）だけ、下に余白を付ける */
.app > .site-footer {
  padding-bottom: 2.5rem;
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
  /* opacity: 0.6; */
}

.site-footer span {
  margin: 0 0.5rem;
  /* opacity: 0.4; */
}

/* ---------- 共通ヘッダー ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: var(--header-h) 1fr var(--header-h);
  align-items: center;
  height: var(--header-h);
  background: #080d2a;
}

/* ハンバーガー(3本線) */
.site-header__burger {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: var(--header-h);
  height: 100%;
  padding: 0 14px;
}

.site-header__burger span {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: #fff;
}

/* タイトルロゴ(左右の列が同じ幅なので、自動で中央に来る) */
.site-header__title {
  justify-self: center;
  line-height: 0;
}

.site-header__title img {
  display: block;
  height: 48px;
  width: auto;
}

/* ホームロゴ */
.site-header__home {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--header-h);
  height: 100%;
}

.site-header__home img {
  display: block;
  width: 40px;
  height: auto;
}

/* ---------- メニュー(ヘッダーの下に開く) ---------- */

.site-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 56%;
  min-height: 420px;
  padding: 1rem 1rem 2rem;
  background: #f2e8de;
  color: var(--color-ink);
  border: 1px solid #302e39;
}

/* ✕ボタン(2本の線を重ねて描く) */
.site-menu__close {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  width: 36px;
  height: 36px;
  margin-bottom: 0.8rem;
}

.site-menu__close::before,
.site-menu__close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 3px;
  background: var(--color-ink);
}

.site-menu__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.site-menu__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.site-menu__list {
  list-style: none;
}

.site-menu__list li + li {
  /* margin-top: 1.4rem; */
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(28, 26, 22, 0.15)
}

.site-menu__list a,
.site-menu__disabled {
  /* display: block;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.4;
  color: inherit;
  text-decoration: none; */
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.5;
  color: inherit;
  text-decoration: none;
}

.site-menu__disabled {
  cursor: default;
}

.site-menu__badge {
  /* margin-left: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #e60012; */
  margin-left: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #e60012;
}

.site-menu__sub {
  list-style: none;
  margin-top: 1.4rem;
}

.site-menu__sub a {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: inherit;
  text-decoration: none;
}

/* ===== テーマ別 ===== */
.themes { padding: 2.2rem 1rem 3rem; }
.themes__title {
  text-align: center; font-family: var(--font-display);
  font-size: 1.3rem; letter-spacing: 0.06em; margin-bottom: 1.6rem;
}

.theme-tabs {
  display: flex; justify-content: center; margin-bottom: 1.4rem;
  overflow-x: auto;            /* カテゴリーが増えても横スクロールで対応 */
}
.theme-tabs__item {
  position: relative; flex: none;
  background: none; border: 0; cursor: pointer;
  padding: 0.2rem 0.9rem;
  font-family: var(--font-display); font-size: 1.25rem; letter-spacing: 0.04em;
  color: var(--color-ink);
}
.theme-tabs__item + .theme-tabs__item::before {   /* 縦の区切り線 */
  content: ''; position: absolute; left: 0; top: 18%; height: 64%;
  border-left: 1px solid var(--color-ink);
}
.theme-tabs__item.is-active {
  color: #e60012;
  border-bottom: 1px solid var(--color-ink);
}

.theme-list:not([hidden]) { display: grid; gap: 1rem; list-style: none; margin: 0; padding: 0 0.8rem; }
.theme-list__empty { text-align: center; padding: 1.5rem 0; opacity: 0.7; }

/* ===== テーマ枠（トップ一覧／説明ページ／結果ページ 共通） ===== */
.theme-card {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.8rem 0.9rem;
  background: #fff;
  border: 1px solid #0a0e2a; border-radius: 0;
  box-shadow: 2px 3px 5px rgba(0, 0, 0, 0.3);
  color: var(--color-ink); text-decoration: none;
  text-align: left;
}
.theme-card__logo {
  flex: none; 
  width: 3rem; 
  height: 3rem; 
  border-radius: 50%;
  border: 1px solid #0a0e2a; 
  background: #fff; 
  overflow: hidden;
  display: grid; 
  place-items: center; 
  font-size: 0.9rem; 
  font-weight: 700;
}
.theme-card__logo img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; }
/* ロゴ画像があるときは、枠・背景・丸い切り抜きをやめて、画像そのものを見せる */
.theme-card__logo--img {
  border: 0;
  background: none;
  border-radius: 0;
  overflow: visible;
}
.theme-card__logo--img img {
  object-fit: contain;     /* 切り抜かず、全体を表示する */
}
.theme-card__title {
  min-width: 0; margin: 0;
  font-size: 1.3rem; font-weight: 700; line-height: 1.5;
}
/* 一覧のリンク枠だけ、右端に「>」 */
a.theme-card::after {
  content: ''; flex: none; margin-left: auto; margin-right: 0.2rem;
  width: 0.65rem; height: 0.65rem;
  border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

/* ===== 公開予定／NEW ===== */
.theme-card { position: relative; }

/* 公開前のカード：押せない。右下の公開予定が入る分、下を広げる */
.theme-card--soon { padding-bottom: 1.9rem; cursor: default; }
.theme-card__soon-label {
  position: absolute; right: 0.7rem; bottom: 0.45rem;
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0.04em; line-height: 1;
  color: #e60012;
}
/* 確認モードで見えている、まだ一覧に出ない占い（点線で区別） */
.theme-card--preview { border-style: dashed; }

/* NEW：カードの左上の外側に、赤く点滅 */
.theme-card__new {
  position: absolute; left: 0.15rem; bottom: 100%; margin-bottom: 0.2rem;
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.06em; line-height: 1;
  color: #e60012;
  animation: new-blink 1.3s ease-in-out infinite;
}
@keyframes new-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.15; }
}
@media (prefers-reduced-motion: reduce) {
  .theme-card__new { animation: none; }      /* 「視覚効果を減らす」設定の人には点滅させない */
}

/* 確認モードの帯 */
.preview-bar {
  margin: 0; padding: 0.4rem 0.8rem;
  background: #fff3c4; color: var(--color-ink);
  font-size: 0.75rem; text-align: center;
}
.preview-bar a { color: inherit; margin-left: 0.5rem; }

/* ===== 占いの説明ページ ===== */
.reading { 
  padding: 1.6rem 1.2rem 3rem; 
  color: var(--color-ink);
}

.reading .theme-card { 
  margin-bottom: 1.4rem; 
}

.reading__subtitle { 
  font-size: 1rem; 
  font-weight: 700; 
  line-height: 1.8; 
  margin-bottom: 1.2rem; 
}

.reading__positions {
  list-style: none; 
  width: fit-content; 
  margin: 0 auto 1.4rem; 
  padding: 0;
  font-size: 0.95rem; 
  font-weight: 700; 
  line-height: 1.9; 
  letter-spacing: 0.04em;
  text-align: center; 
}

.reading__back-card { 
  display: block; 
  width: 7rem; 
  height: auto; 
  margin: 0 auto 1.8rem; 
}

.reading__lead { 
  text-align: center; 
  font-size: 1.05rem; 
  font-weight: 700; 
  line-height: 1.8; 
  margin-bottom: 1rem; 
}

.reading__btn { 
  display: block; 
  margin: 0 auto; 
  background: none; 
  border: 0; 
  cursor: pointer; 
}

.reading__btn img { 
  display: block; 
  width: 15rem; 
  max-width: 80%; 
  margin: 0 auto; 
}

.reading__btn:disabled { 
  opacity: 0.6; 
}

.reading__btn-link {
  display: block; width: fit-content; margin: 0 auto; padding: 0.8rem 2rem;
  border: 2px solid #0a0e2a; border-radius: 999px;
  color: inherit; text-decoration: none; font-weight: 700;
}

.reading__status { 
  text-align: center; 
  margin-top: 0.8rem; 
  font-size: 0.85rem; 
}

.reading__note { 
  text-align: center; 
  margin-top: 1.6rem; 
  font-size: 0.75rem; 
  font-weight: 700; 
  line-height: 1.8; 
 }

 /* ===== 占いの結果ページ ===== */
.reading-result { 
  padding: 1.6rem 1rem 3rem; 
  color: var(--color-ink);
}

.reading-result .theme-card { 
  margin: 0 0.2rem 1.2rem; 
}

.reading-result__subtitle { 
  font-size: 0.85rem; 
  line-height: 1.8; 
  padding: 0 1rem; 
  margin-bottom: 1.2rem; 
}

.rr-card {
  --rr-gap: 0.9rem;     /* ← 余白の基準。線の上下とも、この値 */
  --rr-pad: 0.6rem;     /* ← セクションの左右の余白 */
  border-top: 1px solid var(--color-ink);
  padding: var(--rr-gap) var(--rr-pad) 1.6rem;
  text-align: center;
}

/* .rr-list > .rr-card:last-child { 
  border-bottom: 1px solid var(--color-ink); 
} */

.rr-card__label {
  /* 左右の余白を打ち消して、線をセクションいっぱいに伸ばす */
  margin: 0 calc(var(--rr-pad) * -1) var(--rr-gap);
  padding-bottom: var(--rr-gap);
  border-bottom: 1px solid var(--color-ink);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.04em;
}

.rr-card__image { 
  display: inline-block; 
}

.rr-card__image img { 
  display: block; 
  /* width: 8rem;  */
  width: 300px; 
  height: auto; 
}   /* ← カードの大きさ */

.rr-card__image img.is-reversed { 
  transform: rotate(180deg); 
}

.rr-card__noimg {
  display: grid; place-items: center; width: 6.5rem; aspect-ratio: 3 / 5;
  border: 1px dashed currentColor; font-size: 0.75rem; opacity: 0.6;
}

.rr-card__name { 
  margin: 0.7rem 0 1rem; 
  line-height: 1.5; 
}

.rr-card__name-en { 
  display: block; 
  font-size: 1.15rem; 
  letter-spacing: 0.1em; 
}

.rr-card__name-ja { 
  display: block; 
  font-size: 0.95rem; 
}

.rr-card__text { 
  text-align: left; 
  font-size: 0.9rem; 
  line-height: 1.95; 
  padding: 0 0.4rem; 
}

.ad-slot {
  background: rgba(0, 0, 0, 0.03);
  border: 1px dashed rgba(28, 26, 22, 0.25);
  border-radius: 12px;
  padding: 1.4rem;
  text-align: center;
  color: var(--color-ink);
}

.ad-slot__label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  /* opacity: 0.6; */
  margin-bottom: 0.5rem;
  color: var(--color-sky-top);
}

.ad-slot__placeholder {
  font-size: 0.85rem;
  /* opacity: 0.7; */
}

.ad-slot__code {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* ===== Xで投稿ボタン ===== */
.share-x {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: fit-content; margin: 1.4rem auto 0; padding: 0.75rem 1.6rem;
  background: #000; color: #fff; text-decoration: none;
  border-radius: 999px; font-size: 0.9rem; font-weight: 700; letter-spacing: 0.04em;
}
.share-x svg { width: 1rem; height: 1rem; fill: currentColor; }
.share-x:active { opacity: 0.8; }