:root {
  --bg-navy: #0f1a2b;
  --text-cream: #f4ecd8;
  --gold: #c9a45c;
  --gold-soft: #e6d3a3;
}

/* ===== リセット ===== */
* {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* ===== 背景 & 全体 ===== */
body {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  background: radial-gradient(circle at top, #16233a, var(--bg-navy));
  color: var(--text-cream);
  min-height: 100svh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

/* ===== 外枠 ===== */
.card-frame {
  width: 100%;
  max-width: 520px;
  padding: 56px 28px 52px;
  border: 1px solid rgba(201,164,92,0.45);
  border-radius: 20px;
  background: rgba(15,26,43,0.78);
  box-shadow: 0 0 40px rgba(0,0,0,0.6);
}

/* ===== タイトル ===== */
.site-title {
  font-family: "Zen Old Mincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 40px;
  font-weight: 300;
  letter-spacing: 0.16em;
  text-align: center;
  margin: 0 0 48px;
  color: var(--gold-soft);
  position: relative;
  padding-bottom: 20px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.site-title::after {
  content: "";
  display: block;
  width: 160px;
  height: 1px;
  margin: 18px auto 0;
  background: linear-gradient(
    to right,
    transparent,
    var(--gold-soft),
    transparent
  );
  opacity: 0.65;
}

/* ===== タイトルロゴ ===== */
.title-logo {
  display: block;
  margin: 0 auto 44px;
  width: 180px;
  max-width: 60vw;
  height: auto;
  opacity: 0.95;
  pointer-events: none;
}

/* ===== メインコピー ===== */
.lead {
  font-size: 17px;
  line-height: 2.1;
  text-align: center;
  margin-bottom: 64px;
}

/* ===== 迎えの文章 ===== */
.lead-welcome {
  font-size: 16px;
  line-height: 2.1;
  text-align: center;
  opacity: 0.75;
  margin-bottom: 64px;
}

/* ===== 検索寄り説明文（調整後） ===== */
.site-description {
  margin: 0 0 64px;
  font-size: 14px;
  line-height: 2.0;
  text-align: center;
  opacity: 0.75;
  color: rgba(244, 236, 216, 0.85);
}

/* ===== 行動への導線 ===== */
.lead-sub {
  font-size: 15px;
  line-height: 2.0;
  text-align: center;
  opacity: 0.65;
  margin-bottom: 56px;
}

/* ===== 入力欄 ===== */
.input-wrap {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(201,164,92,0.35);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 44px;
}

.editable {
  min-height: 140px;
  font-size: 16px;
  line-height: 1.9;
  outline: none;
  white-space: pre-wrap;
}

/* placeholder */
.editable:empty::before {
  content: attr(data-placeholder);
  color: rgba(244,236,216,0.55);
}

/* ===== ボタン ===== */
button {
  width: 100%;
  padding: 18px;
  font-size: 16px;
  letter-spacing: 0.14em;
  background: transparent;
  color: var(--gold-soft);
  border: 1px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
}

button:hover {
  background: rgba(201,164,92,0.18);
}

/* ===== 結果表示 ===== */
.result {
  margin-top: 64px;
  display: none;
}

/* ===== カードヘッダー ===== */
.card-header {
  text-align: center;
  margin-bottom: 44px;
}

/* ===== カード画像枠 ===== */
.card-image-wrap {
  width: 160px;
  height: 280px;
  margin: 0 auto 28px;
  border-radius: 16px;
  border: 1px solid rgba(201,164,92,0.4);
  background: rgba(255,255,255,0.04);
  box-shadow: 0 0 24px rgba(0,0,0,0.4);
  overflow: hidden;
}

.card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: fadeCard 1.2s ease forwards;
}

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

/* ===== カード名 ===== */
.card-title {
  color: var(--gold);
  letter-spacing: 0.14em;
  font-size: 15px;
}

/* ===== 占い本文 ===== */
.section-title {
  margin: 36px 0 14px;
  font-weight: bold;
  color: var(--gold-soft);
}

.section-card {
  border: 1px solid rgba(201,164,92,0.3);
  border-radius: 14px;
  padding: 22px;
  background: rgba(255,255,255,0.04);
}

.section-body {
  font-size: 15px;
  line-height: 2.0;
  white-space: pre-wrap;
}

/* ===== フッター ===== */
.footer-note {
  margin-top: 56px;
  font-size: 13px;
  text-align: center;
  opacity: 0.6;
}

.footer-links {
  margin-top: 16px;
  text-align: center;
}

.footer-links a,
.footer-links a:visited {
  font-size: 12px;
  color: rgba(244, 236, 216, 0.6);
  text-decoration: none;
}

.footer-links a:hover {
  color: rgba(244, 236, 216, 0.9);
  text-decoration: underline;
}

.footer-credit {
  margin-top: 18px;
  font-size: 11px;
  text-align: center;
  opacity: 0.45;
  letter-spacing: 0.1em;
  user-select: none;
}

/* ===== 占い後の締め文 ===== */
.result-closing {
  margin-top: 72px;
  font-size: 14px;
  line-height: 2.0;
  text-align: center;
  opacity: 0.75;
}

/* ===== ページ末 SEO / 思想テキスト ===== */
.seo-text {
  margin: 96px auto 72px;
  max-width: 420px;
  display: flex;	
  flex-direction: column;	
  align-items: center;
  text-align: center;
  opacity: 0.55;
}

.seo-text .seo-title {
  margin-bottom: 28px;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--gold-soft);
  font-weight: 400;
}

.seo-text .seo-body {
  font-size: 12.5px;
  line-height: 2.1;
  color: rgba(244, 236, 216, 0.7);
}

/* ===== 応援ページへの静かな導線 ===== */
.support-link {
  margin: 56px 0 64px;
  font-size: 13px;
  line-height: 2.0;
  text-align: center;
  opacity: 0.6;
}

.support-link-button {
  margin-top: 32px;
}

.support-link-button a {
  display: inline-block;
  min-width: 320px;
  padding: 12px 28px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--gold-soft);
  border: 1px solid rgba(201,164,92,0.35);
  border-radius: 999px;
  text-decoration: none;
  text-align: center;
}

/* ===== 飾り文字 ===== */
.decorative {
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

/* ===== scroll reveal ===== */
.fade-step {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.1s ease, transform 1.1s ease;
}

.fade-step.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== スマホ最適化 ===== */
@media (max-width: 480px) {
  body {
    padding: 16px;
  }

  .card-frame {
    padding: 48px 22px 44px;
    border-radius: 16px;
  }

  .site-title {
    font-size: 32px;
    letter-spacing: 0.20em;
    margin-bottom: 40px;
  }

  .lead {
    font-size: 16px;
    margin-bottom: 56px;
  }

  .lead-welcome {
    font-size: 15px;
    margin-bottom: 56px;
  }

  .site-description {
    font-size: 13.5px;
  }

  .lead-sub {
    font-size: 14px;
    margin-bottom: 48px;
  }

  .seo-text .seo-title {
    font-size: 13px;
  }

  .seo-text .seo-body {
    font-size: 12px;
  }

  .title-logo {
    width: 160px;
    margin-bottom: 36px;
  }

  .support-link-button a {
    min-width: 260px;
  }
}

/* ===== 星背景 ===== */
#starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ===== ローディング画面 ===== */
.loading-screen {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #16233a, #0f1a2b);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.loading-screen.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.loading-image {
  width: 220px;
  max-width: 70%;
  margin-bottom: 20px;
  animation: gentleScale 3.2s ease-in-out infinite;
}

@keyframes gentleScale {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.loading-text {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--text-cream);
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* ===== 結果フェード表示 ===== */
.result.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}