/* ======================================= */
/* 1. 基本設定と変数定義
/* ======================================= */
:root {
  --primary: #6C63FF;
  --secondary: #FF6584;
  --bg: #F9FAFB;
  --text: #333;
  --radius: 12px;
  --transition: .3s;
}

/* ======================================= */
/* 2. グローバルスタイルとリセット
/* ======================================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

a {
  color: inherit !important;
  text-decoration: none;
}

a:visited, a:link, a:active {
  color: inherit !important;
}

/* ======================================= */
/* 3. 全体レイアウト (PC)
/* ======================================= */
body {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(
    45deg,
    rgba(255, 99, 71, 0.2),
    rgba(255, 165, 0, 0.2),
    rgba(255, 255, 0, 0.2),
    rgba(50, 205, 50, 0.2),
    rgba(0, 191, 255, 0.2),
    rgba(75, 0, 130, 0.2),
    rgba(238, 130, 238, 0.2)
  );
  background-size: 400%;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 16px;
  animation: rainbow 8s ease infinite;
}

@keyframes rainbow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.container {
  width: 100%;
  max-width: 600px;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 24px;
  margin: 16px auto;
}

header, footer {
  background: rgba(255, 255, 255, 0.9);
  padding: 12px;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
}

header {
  border-bottom: 1px solid #ddd;
}

footer {
  border-top: 1px solid #ddd;
}

.header-nav, .footer-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.header-nav a, .footer-nav a {
  text-decoration: none;
  color: #000000 !important;
  font-weight: 400;
  font-size: 0.75rem;
  padding: 0 6px;
  transition: color var(--transition);
}

.header-nav a:hover, .footer-nav a:hover {
  color: var(--secondary);
}

.header-nav .divider, .footer-nav .divider {
  color: #000000 !important;
  font-size: 0.75rem;
  font-weight: 400;
}

.copyright {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 400;
  color: #000000;
  text-align: center;
  margin-top: 12px;
}

/* ======================================= */
/* 4. タイトルとテキストスタイル (PC)
/* ======================================= */
h1 {
  text-align: center;
  font-weight: 700;
  margin-bottom: 24px; /* ★修正：タイトルと動画の間の余白を確保 */
  color: var(--primary);
}

.title-topt {
  font-weight: 700;
  text-align: center;
  display: block;
  margin-bottom: 8px;
  color: var(--secondary);
  text-shadow: 
    1px 1px 2px rgba(0, 0, 0, 0.3),
    0 0 4px rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
}

.title-english {
  font-size: 2rem;
  font-weight: 700;
}

.title-japanese {
  font-size: 1.25rem;
  font-weight: 700;
}

.title-sub {
  font-size: 1rem;
  display: block;
}

/* 結果ページのタイトル */
.title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 12px;
  text-align: left;
  display: inline-block;
  padding: 2px 12px;
  border-radius: 4px;
  color: #fff !important;
  text-shadow: -1px -1px 0 #000, 0 -1px 0 #000, 1px -1px 0 #000, -1px 0 0 #000, 1px 0 0 #000, -1px 1px 0 #000, 0 1px 0 #000, 1px 1px 0 #000;
  position: relative;
  overflow: hidden;
}

.compatible-title {
  font-size: 1.5rem;
  font-weight: 400;
  text-align: left;
  margin-bottom: 12px;
  color: var(--text);
}

#resultScreen h3,
#resultText h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 12px;
  color: var(--primary);
}

#resultText p {
  font-size: 1rem;
  margin-bottom: 12px;
}

#resultText .result-description-first {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: #000000 !important; 
  margin-bottom: 12px;
}

/* ======================================= */
/* 5. コンポーネントスタイル (PC)
/* ======================================= */
/* 汎用ボタン */
button {
  font: inherit;
  font-size: 1rem;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

button:hover {
  background: var(--secondary);
  transform: scale(1.02);
}

/* 診断開始ボタン */
#startBtn {
  width: 100%;
  margin: 0; /* ★修正：個別marginをリセット */
}

/* 診断画面 */
.screen { display: none; }
.screen.active { display: block; }

/* メインページの各要素の間の余白を統一 */
#startScreen > * {
  margin-bottom: 16px; /* ★追加：各要素の下に16pxの余白を標準設定 */
}
#startScreen > *:last-child {
  margin-bottom: 0; /* ★追加：最後の要素の余白は削除 */
}

/* プログレスバー */
.progress-bar {
  height: 8px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-inner {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width var(--transition);
}

/* 質問画面 */
.question h2 { font-size: 1.25rem; margin-bottom: 12px; }
.options { list-style: none; padding: 0; margin-bottom: 12px; }
.options li { margin-bottom: 12px; }
.options li.selected button { background: var(--secondary); color: #fff; }
.options button {
  width: 100%;
  text-align: left;
  background: #f9f9f9;
  color: var(--text);
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  transition: background var(--transition), border-color var(--transition);
}
@media (hover: hover) {
  .options button:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
  }
}
.nav { display: flex; justify-content: space-between; }

/* 結果画面のボタン */
.share-row, .goods-row, .restart-row { display: flex; width: 100%; margin-top: 12px; margin-bottom: 12px; flex-wrap: nowrap; }
.share-row button, .goods-row button, .restart-row button { flex: 1; }
#shareXBtn { background: #1DA1F2; }
#goodsBtn { background: var(--primary); color: #fff; flex: 1; }
#goodsBtn:hover { background: var(--secondary); transform: scale(1.02); }
.restart-row button { flex: 1; background: #fff; color: var(--primary); border: 1px solid var(--primary); }

/* 画像コンテナ */
.start-image, .result-image {
  width: 100%;
  background: #ecebff;
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 2; 
  margin-bottom: 0; /* ★修正：個別marginをリセット */
}
.start-image picture, .start-image img, .start-image video { width: 100%; height: auto; object-fit: contain; }
.result-image { aspect-ratio: 4 / 3; }
.result-image img { width: 100%; height: 100%; object-fit: cover; }

/* アコーディオン (詳しく見る) */
.accordion { margin-bottom: 12px; }
.accordion-toggle {
  background: var(--primary); color: #fff; border: none; padding: 6px 12px; border-radius: var(--radius);
  cursor: pointer; font-size: 1rem; margin-top: 12px; display: inline-flex;
  align-items: center; gap: 12px; transition: background var(--transition), transform var(--transition);
}
.accordion-toggle:hover { background: var(--secondary); transform: scale(1.02); }
.accordion-toggle .arrow { font-size: 0.9rem; }
.accordion-content {
  margin-top: 12px; font-size: 1rem; line-height: 1.5; max-height: 0;
  opacity: 0; overflow: hidden; transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}
.accordion-content.open { opacity: 1; max-height: 2000px; }

/* その他パーツ */
.color-name {
  font-weight: 600; border: 1px solid #ddd; padding: 2px 8px; border-radius: 4px;
  text-shadow: -1px -1px 0 #000, 0 -1px 0 #000, 1px -1px 0 #000, -1px 0 0 #000, 1px 0 0 #000, -1px 1px 0 #000, 0 1px 0 #000, 1px 1px 0 #000;
}
hr { border: 0; border-top: 1px solid #ddd; margin: 12px 0; }

/* ======================================= */
/* 6. 今日のラッキーパートナル (PC) - 色を金色に変更
/* ======================================= */
#lucky-pertonal-section {
  width: 100%;
  max-width: 600px;
  margin: 12px auto 12px;
  padding: 12px;
  background: #fff;
  border-radius: var(--radius);
  text-align: center;
  border: 4px solid #FFD700; /* 金色の線に変更 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#lucky-pertonal-section h3 {
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: #DAA520; /* 金色（少し濃いめ）に変更 */
  text-shadow: 
    1px 1px 2px rgba(0, 0, 0, 0.3),
    0 0 4px rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
}

#lucky-pertonal-display { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }
#lucky-pertonal-display span {
  color: #fff; font-size: 1.5rem; font-weight: 700; padding: 2px 12px; border-radius: 4px;
  text-shadow: -1px -1px 0 #000, 0 -1px 0 #000, 1px -1px 0 #000, -1px 0 0 #000, 1px 0 0 #000, -1px 1px 0 #000, 0 1px 0 #000, 1px 1px 0 #000;
  position: relative; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); transition: transform 0.2s ease;
}
#lucky-pertonal-display span:active { transform: scale(0.98); }
#lucky-pertonal-display span::before {
  content: ''; position: absolute; top: 0; left: -85%; width: 50%; height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg); animation: shine 3s infinite;
}
@keyframes shine { 0% { left: -85%; } 20% { left: 120%; } 100% { left: 120%; } }

/* ======================================= */
/* 7. 静的ページ用スタイル (PC)
/* ======================================= */
.content h2 { font-size: 1.25rem; font-weight: 700; color: var(--primary); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.content h2::before { font-size: 1.5rem; }
.content p { font-size: 1rem; line-height: 1.6; color: var(--text); margin-bottom: 12px; }
.content ul { list-style: disc; margin-left: 12px; margin-bottom: 12px; }
.content li { font-size: 1rem; line-height: 1.6; color: var(--text); margin-bottom: 12px; }
.type-image {
  width: 100%; background: #ecebff; border-radius: var(--radius); margin-bottom: 12px;
  overflow: hidden; display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3;
}
.type-image picture, .type-image img { width: 100%; height: auto; object-fit: contain; }
button.back-btn {
  font: inherit; font-size: 1rem; padding: 12px 20px; border: none; border-radius: var(--radius);
  background: var(--primary); color: #fff; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  width: 100%; margin-top: 12px;
}
button.back-btn:hover { background: var(--secondary); transform: scale(1.02); }

/* ======================================= */
/* 8. レスポンシブスタイル (スマホ用)
/* ======================================= */
@media (max-width: 600px) {
  /* レイアウト */
  .container { padding: 16px; }

  /* トップページ */
  .start-image { aspect-ratio: 1 / 1; }
  
  /* 結果ページ */
  .result-image { aspect-ratio: 4 / 3; }
  
  /* テキスト */
  .title-english { font-size: 2rem; }
  .title-japanese { font-size: 1.25rem; }

  /* 静的ページ */
  .content h2 { font-size: 1.25rem; }
  .content p, .content li, .content dt, .content dd { font-size: 1rem; }
  button.back-btn { padding: 12px; }
}

 #lucky-pertonal-section h3 {
    font-size: 1.2rem; /* スマホ表示の際の文字サイズを小さくする */
  }

@media (max-width: 480px) {
  /* ラッキーパートナル */
  #lucky-pertonal-display { gap: 8px; }
  #lucky-pertonal-display span { font-size: 1rem; padding: 6px 12px; }
}

/* ======================================= */
/* 9. ラッキーパートナル説明文のスタイル
/* ======================================= */
.lucky-description {
  font-size: 0.875rem; /* 少し小さめの文字サイズ */
  line-height: 1.6;   /* 行間を読みやすく調整 */
  color: var(--text); /* 基本のテキストカラー */
  margin-top: 16px;   /* ★修正：パートナル表示との間に上の余白を確保 */
  padding: 0 12px;    /* 左右に少し余白をとって中央に寄せる */
  text-align: left;  /* ← この行を追加して右揃えにします */
}

/* ======================================= */
/* 10. 診断開始ボタンのアニメーション
/* ======================================= */

/* ボタン内の要素を横並びにする設定 */
#startBtn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px; /* 文字と矢印の間の隙間 */
}

/* 矢印の基本状態 */
.arrows span {
  opacity: 0.2; /* 常に薄く表示 */
  animation-duration: 3s; /* アニメーション全体の長さを3秒に設定 */
  animation-iteration-count: infinite; /* 無限に繰り返す */
}

/* 1秒目に点灯するアニメーション */
@keyframes blink-step-1 {
  0%, 33.3% { opacity: 1; } /* 0秒から1秒の間だけ点灯 */
  33.4%, 100% { opacity: 0.2; } /* それ以外は薄く表示 */
}

/* 2秒目に点灯するアニメーション */
@keyframes blink-step-2 {
  0%, 33.3% { opacity: 0.2; }
  33.4%, 66.6% { opacity: 1; } /* 1秒から2秒の間だけ点灯 */
  66.7%, 100% { opacity: 0.2; }
}

/* 3秒目に点灯するアニメーション */
@keyframes blink-step-3 {
  0%, 66.6% { opacity: 0.2; }
  66.7%, 99.9% { opacity: 1; } /* 2秒から3秒の間だけ点灯 */
  100% { opacity: 0.2; }
}

/* 1秒目：一番外側の矢印を点滅させる */
.arrows-left span:nth-child(1),
.arrows-right span:nth-child(3) {
  animation-name: blink-step-1;
}

/* 2秒目：真ん中の矢印を点滅させる */
.arrows-left span:nth-child(2),
.arrows-right span:nth-child(2) {
  animation-name: blink-step-2;
}

/* 3秒目：一番内側の矢印を点滅させる */
.arrows-left span:nth-child(3),
.arrows-right span:nth-child(1) {
  animation-name: blink-step-3;
}

/* ======================================= */
/* 11. 相性の良いパートナル表示 (デザイン調整)
/* ======================================= */

/* 4つのパートナルを縦に並べるためのコンテナ設定 */
.compatible-types-container {
  display: flex;
  flex-direction: column; /* ★★★ アイテムを縦に並べる ★★★ */
  align-items: flex-start;  /* ★★★ アイテムを左揃えにする ★★★ */
  gap: 12px;
  margin-bottom: 12px;
}

/* パートナルタグのサイズを調整 */
.compatible-tag {
  display: inline-block;
  font-size: 1.1rem; /* ★★★ サイズを小さく調整 ★★★ */
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  color: #fff !important;
  text-shadow: -1px -1px 0 #000, 0 -1px 0 #000, 1px -1px 0 #000, -1px 0 0 #000, 1px 0 0 #000, -1px 1px 0 #000, 0 1px 0 #000, 1px 1px 0 #000;
  transition: transform 0.2s ease;
}

.compatible-tag:hover {
  transform: scale(1.05);
}

/* 古いスタイルは不要になるので非表示に */
.compatible-title {
  display: none; 
}

/* ======================================= */
/* 12. 人気曲リスト (音楽プレイヤー風)
/* ======================================= */
.playlist {
  display: flex;
  flex-direction: column;
  gap: 12px; /* プレーヤー間の余白 */
}

/* 以前の.playlist-trackや.play-btnなどのスタイルは不要なので削除します */

/* ======================================= */
/* 13. リッチフッター (影効果を追加)
/* ======================================= */

/* フッター全体の背景とパディング */
footer {
  background: #f8f9fa;
  color: #6c757d;
  padding: 40px 16px;
  border-top: 1px solid #dee2e6;
  width: 100%;
  box-sizing: border-box;
}

.footer-container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  text-align: left;
}

/* 上段（サイト紹介とナビゲーション） */
.footer-main {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #dee2e6;
}

.footer-about, .footer-sitemap {
  flex: 1;
  min-width: 250px;
}

.footer-about h4 {
  font-size: 1.25rem;
  color: var(--secondary);
  margin-bottom: 12px;
  /* ★★★ 影の効果を追加 ★★★ */
  text-shadow: 
    1px 1px 2px rgba(0, 0, 0, 0.3),
    0 0 4px rgba(255, 255, 255, 0.5);
}

.footer-about p {
  font-size: 0.9rem;
  line-height: 1.6;
}

.footer-sitemap h4 {
  font-size: 1.0rem;
  color: var(--primary);
  margin-bottom: 12px;
  /* ★★★ 影の効果を追加 ★★★ */
  text-shadow: 
    1px 1px 2px rgba(0, 0, 0, 0.3),
    0 0 4px rgba(255, 255, 255, 0.5);
}

.footer-sitemap ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-sitemap li {
  margin-bottom: 8px;
}

.footer-sitemap a {
  font-size: 0.9rem;
  color: #6c757d !important;
  text-decoration: none !important;
  transition: color 0.2s ease;
}

.footer-sitemap a:hover {
  color: var(--secondary) !important;
}

/* 下段（規約リンクとコピーライト） */
.footer-secondary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
}

.footer-secondary .footer-nav {
  gap: 12px;
  margin-bottom: 8px;
}

.footer-secondary .footer-nav a {
  color: #6c757d !important;
}

/* 下段（規約リンクとコピーライト） */
.footer-secondary {
  display: flex;
  flex-wrap: wrap; /* 画面が狭い時に折り返す設定は維持 */
  justify-content: center; /* ★★★ space-betweenからcenterに変更 ★★★ */
  align-items: center;
  font-size: 0.75rem;
  gap: 16px; /* リンクとコピーライトの間のスペースを確保 */
}

.footer-secondary .footer-nav {
  gap: 12px;
  margin-bottom: 0; /* 不要なマージンをリセット */
}

/* ★★★ コピーライトのテキストも中央揃えに指定 ★★★ */
.footer-secondary .copyright {
    text-align: center;
}

/* ======================================= */
/* 14. 汎用シャインエフェクト (追加)
/* ======================================= */

/* エフェクトをかけたい画像の親要素にこのクラスを追加 */
.shine-effect {
  position: relative; /* 疑似要素を配置する基準点にする */
  overflow: hidden;   /* はみ出した光を隠す */
  display: inline-block; /* 画像のサイズに合わせる */
}

/* 光の帯を疑似要素で作成 */
.shine-effect::after {
  content: '';
  position: absolute;
  top: 0;
  left: -150%; /* 初期位置は左の見えない位置 */
  width: 40%;
  height: 100%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: skewX(-25deg); /* 光を斜めにする */
  animation: shine 3s infinite; /* アニメーションを適用 */
}

/* アニメーションの定義（既存のものと同じ） */
@keyframes shine {
  0% {
    left: -150%;
  }
  20% {
    left: 150%;
  }
  100% {
    left: 150%;
  }
}

/* ======================================= */
/* X. 相性シミュレーター (追加)
/* ======================================= */
#compatibility-section {
  width: 100%;
  max-width: 600px;
  margin: 12px auto;
  padding: 24px;
  background: #fff;
  border-radius: var(--radius);
  text-align: center;
  border: 4px solid var(--secondary); /* ピンクの線 */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#compatibility-section h3 {
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--secondary); /* ピンクのタイトル */
  text-shadow: 
    1px 1px 2px rgba(0, 0, 0, 0.3),
    0 0 4px rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
}

.compatibility-description {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 16px;
  padding: 0 12px;
  text-align: left;
}

#compatibilityBtn {
  width: 100%;
  background: var(--secondary); /* ボタンもピンクに */
}
