/* ============================
   全体
============================ */

#diagnosis-app {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
               "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

#diagnosis-question {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
}

#diagnosis-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 作品画像とボタンの間に余白 */
.recommend-item img {
  display: block;
  margin-bottom: 24px;
}

/* ボタン同士の余白 */
.recommend-item a {
  display: block;
  margin-top: 14px;
}

/* カード全体は中央基準 */
.recommend-item {
  text-align: center;
}

/* タイトルは左寄せ */
.recommend-title {
  text-align: left;
}

/* 画像を確実に中央 */
.recommend-item img {
  display: block;
  margin: 0 auto 24px;
}

/* ボタン中央寄せ */
.recommend-item a {
  margin: 14px auto 0;
  text-align: center;
}

/* 2位・3位も同基準 */
.rank-others .recommend-item {
  text-align: center;
}

/* 問題数の表示 */
.diagnosis-progress {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
  text-align: left;
}


/* ============================
   選択肢ボタン
============================ */

.diagnosis-choice {
  padding: 14px 16px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.diagnosis-choice:hover {
  background: #f5f5f5;
  transform: translateY(-1px);
}

.diagnosis-choice.disabled {
  opacity: 0.5;
  cursor: default;
}

/* ============================
   結果エリア
============================ */

#diagnosis-result {
  margin-top: 40px;
}

.diagnosis-text {
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 32px;
}

/* ============================
   おすすめ作品（カード）
============================ */

.diagnosis-recommend {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* カード共通 */
.recommend-item {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  position: relative;
}

/* ============================
   1位カード強調
============================ */

.recommend-item.rank-1 {
  border: 2px solid #ffb400;
  background: linear-gradient(
    180deg,
    #fff7e0 0%,
    #ffffff 100%
  );
  margin-top: 100px !important;

  padding-top: 28px !important;
  overflow: visible !important;
}

.recommend-item.rank-1::before {
  content: "おすすめ No.1";
  position: absolute;
  top: -14px;
  left: 16px;
  background: #ffb400;
  color: #fff;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 12px;
  z-index: 5;
}

/* ============================
   2位・3位（控えめ）
============================ */

.recommend-item.rank-2 {
  opacity: 0.9;
}

.recommend-item.rank-3 {
  opacity: 0.85;
}

/* ============================
   2位・3位まとめ枠（縦並び固定）
============================ */

.rank-others {
  /* 横並びをやめて縦に固定 */
  display: flex;
  flex-direction: column;
  gap: 16px;

  /* 外枠（1つの枠で囲う） */
  margin-top: 24px;
  padding: 30px 18px 18px;
  border: 2px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  position: relative;
  overflow: visible;
}

/* ラベル：こちらもオススメ！ */
.rank-others::before {
  content: "こちらもオススメ！";
  position: absolute;
  top: -14px;
  left: 16px;
  background: #4b5563;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 2;
}

/* 枠の中の2位・3位カードは「内側」っぽく整える */
.rank-others .recommend-item {
  box-shadow: none;              /* 二重に“カード感”が出るのを防ぐ */
  border: 1px solid #e5e7eb;     /* 内側の区切り */
  border-radius: 10px;
  padding: 16px;
  background: #fff;
}

/* 2位・3位の薄い透過はやめて読みやすく（必要なら） */
.recommend-item.rank-2,
.recommend-item.rank-3 {
  opacity: 1;
}

/* 2位・3位：カード形式をやめて“リスト風”にする */
.rank-others .recommend-item {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  text-align: left !important;   /* 文章とタイトルは左寄せの方が自然 */
}

/* 2位と3位の区切り線だけ残す */
.rank-others .recommend-item + .recommend-item {
  margin-top: 16px !important;
  padding-top: 16px !important;
  border-top: 1px solid #e5e7eb !important;
}


/* ============================
   カード内要素
============================ */

.recommend-item h3 {
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.recommend-content {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 16px;
}

/* ============================
   リンクボタン
============================ */

.recommend-link {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 999px;
  background: #333;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.recommend-link:hover {
  opacity: 0.8;
}

/* ============================
   レスポンシブ
============================ */

@media (min-width: 640px) {
  .diagnosis-shared-result .diagnosis-recommend {
    grid-template-columns: 1fr !important;
  }

  .diagnosis-shared-result .recommend-item.rank-1 {
    grid-column: auto !important;
  }
}

/* ============================
   X投稿ボタン
============================ */

.diagnosis-share {
  margin: 24px 0 40px;
  text-align: center;
}

.share-x-button {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 999px;
  background: #000;
  color: #fff;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
}

.share-x-button:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}


/* ============================
   結果URL専用ヘッダ
============================ */

.diagnosis-shared-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding: 20px 24px;
  background: #f8fbff;
  border: 1px solid #d9e6f5;
  border-radius: 14px;
}



.diagnosis-shared-header__lead {
  margin: 0;
  color: #555;
  line-height: 1.6;
}

.diagnosis-start-button {
  display: inline-block;
  padding: 12px 22px;
  background: #173f9f;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.diagnosis-start-button:hover {
  opacity: 0.92;
  color: #fff;
}

/* ============================
   結果URLページの見た目調整
============================ */

.diagnosis-shared-result {
  padding-top: 0;
}

.diagnosis-shared-result #diagnosis-result {
  margin-top: 0;
}

.diagnosis-shared-result .diagnosis-text {
  margin-bottom: 24px;
}


.diagnosis-shared-result .recommend-title {
  margin-bottom: 16px;
  font-size: 1.25rem;
  line-height: 1.5;
}

.diagnosis-shared-result .recommend-title a {
  color: inherit;
  text-decoration: none;
}

.diagnosis-shared-result .recommend-content {
  margin-top: 8px;
}

/* 結果URL時は 2位・3位の外枠を使わない */


@media (max-width: 767px) {
  .diagnosis-shared-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .diagnosis-shared-header__button {
    width: 100%;
  }

  .diagnosis-start-button {
    display: block;
    width: 100%;
    text-align: center;
  }
}

/* ============================
   共通ページタイトル
============================ */

.diagnosis-page-title {
  margin: 0 0 20px;
  font-size: 1.8rem;
  line-height: 1.4;
  font-weight: 700;
}

/* ============================
   結果URL専用ヘッダ
============================ */

.diagnosis-shared-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding: 20px 24px;
  background: #f8fbff;
  border: 1px solid #d9e6f5;
  border-radius: 14px;
}

.diagnosis-shared-header__lead {
  margin: 0;
  color: #555;
  line-height: 1.6;
}

.diagnosis-start-button {
  display: inline-block;
  padding: 12px 22px;
  background: #173f9f;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.diagnosis-start-button:hover {
  opacity: 0.92;
  color: #fff;
}

@media (max-width: 767px) {
  .diagnosis-shared-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .diagnosis-shared-header__button {
    width: 100%;
  }

  .diagnosis-start-button {
    display: block;
    width: 100%;
    text-align: center;
  }

  .diagnosis-page-title {
    font-size: 1.5rem;
  }
}


.diagnosis-progress {
  margin: 6px 0 18px;
  font-weight: 600;
  color: #444;
}


.share-copy-button {
  display: inline-block;
  margin-left: 12px;
  padding: 12px 20px;
  background: #fff;
  color: #173f9f;
  border: 1px solid #173f9f;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.share-copy-button:hover {
  opacity: 0.92;
}

@media (max-width: 767px) {
  .share-copy-button {
    display: block;
    width: 100%;
    margin: 12px 0 0;
    text-align: center;
  }
}

.share-copy-image-button {
  display: inline-block;
  margin-left: 12px;
  padding: 12px 20px;
  background: #fff;
  color: #173f9f;
  border: 1px solid #173f9f;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.share-copy-image-button:hover {
  opacity: 0.92;
}

.share-copy-image-button:disabled {
  opacity: 0.65;
  cursor: default;
}

@media (max-width: 767px) {
  .share-copy-image-button {
    display: block;
    width: 100%;
    margin: 12px 0 0;
    text-align: center;
  }
}


/* ============================
   診断画面
============================ */
.diagnosis-intro-note {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9fd 100%);
  border: 1px solid #dbe4f3;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.diagnosis-intro-note__lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.75;
  color: #2f3a4a;
  font-weight: 500;
}

.diagnosis-intro-note__age {
  margin: 8px 0 0;
  font-size: 0.84rem;
  line-height: 1.7;
  color: #6b7280;
}

.diagnosis-progress {
  margin: 0 0 18px;
  font-weight: 700;
  color: #3b4455;
}
