/* デザインシステムと共通設定 */
:root {
  --bg-color: #ffe2e2; /* 指定されたパステルピンク */
  --primary-pink: #fbc6d0; /* STARTボタンのピンク */
  --primary-shadow: #e5a4b1; /* ボタンの立体影用 */
  --accent-pink: #e6007e; /* 鮮やかなピンク（テキストや装飾） */
  --card-bg: #ffffff; /* イントロの白いカード背景 */
  --card-survey-bg: #faf6eb; /* アンケートカードのベージュ背景 */
  --text-dark: #333333; /* 本文のテキスト色 */
  --font-en: 'Outfit', sans-serif;
  --font-ja: 'Zen Maru Gothic', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* モバイルのタップハイライトを無効化 */
}

body {
  background-color: #f7f7f7; /* デスクトップ表示時の背景 */
  font-family: var(--font-ja);
  color: var(--text-dark);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

/* アプリ全体のコンテナ（スマホサイズに制限） */
.app-container {
  width: 100%;
  max-width: 450px; /* 一般的なスマートフォンの最大幅 */
  height: 100vh;
  min-height: 600px;
  background-color: var(--bg-color);
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.05); /* デスクトップ表示用のシャドウ */
  display: flex;
  flex-direction: column;
}

/* 画面セクションの基本設定 */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  display: flex;
  flex-direction: column;
  padding: 30px 20px;
  overflow-y: auto; /* 縦スクロールを許可 */
  -webkit-overflow-scrolling: touch; /* モバイルスクロールの滑らかさ向上 */
}

.screen.active {
  opacity: 1;
  visibility: visible;
  z-index: 10;
}

/* ----------------------------------
 * TOPページセクションのスタイル
 * ---------------------------------- */
#top-screen {
  justify-content: center;
  align-items: center;
  gap: 60px;
}

.top-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 50px;
}

/* ロゴ画像ラッパー */
.top-logo-wrapper {
  width: 100%;
  max-width: 360px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 10px;
}

.top-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ボタンコンテナとSTARTボタン */
.action-container {
  z-index: 10;
}

.btn-start {
  background-color: var(--primary-pink);
  color: #ffffff;
  font-family: var(--font-en);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.08em;
  border: none;
  border-radius: 50px;
  padding: 12px 0;
  width: 260px;
  cursor: pointer;
  /* 立体感を出すためのボックスシャドウ */
  box-shadow: 0 6px 0 var(--primary-shadow), 0 10px 15px rgba(0, 0, 0, 0.12);
  transition: all 0.1s ease;
  outline: none;
}

/* タップ/クリック時のエフェクト */
.btn-start:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--primary-shadow), 0 5px 8px rgba(0, 0, 0, 0.12);
}

/* ----------------------------------
 * イントロ画面セクションのスタイル
 * ---------------------------------- */
#intro-screen {
  align-items: center;
  justify-content: flex-start; /* スクロール可能にするため上詰め */
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* 中央寄せにし、ネガティブマージンで重ね合わせる */
  width: 100%;
  height: 80vh; /* 画面高さに近いサイズを確保し、スクロールを促す */
  min-height: 500px;
  flex-shrink: 0; /* スクロール時に潰れないようにする */
}

.intro-title {
  font-family: var(--font-en);
  color: var(--accent-pink);
  font-size: 34px; /* 添付画像に合わせてサイズを大きめに調整 */
  font-weight: 900;
  letter-spacing: 0.05em;
  margin-bottom: -15px; /* カードと少し重ねるためのネガティブマージン */
  z-index: 10; /* カードよりも前面に表示 */
}

.intro-card {
  background-color: var(--card-bg);
  border-radius: 18px;
  width: 100%;
  max-width: 320px;
  padding: 65px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  /* 添付画像のような立体感のある柔らかいシャドウ */
  box-shadow: 0 8px 25px rgba(220, 150, 160, 0.15);
  z-index: 5; /* タイトルやスクロールテキストの下に潜り込ませる */
}

.intro-text {
  font-family: var(--font-ja);
  font-size: 19px;
  color: #333333;
  line-height: 2.0;
  text-align: center;
  font-weight: 700;
}

/* スクロールインジケーター */
.scroll-indicator {
  margin-top: -20px; /* カードと少し重ねるためのネガティブマージン */
  z-index: 10; /* カードよりも前面に表示 */
}

.scroll-text {
  font-family: var(--font-en);
  color: var(--accent-pink);
  font-size: 26px; /* 添付画像に合わせてサイズを大きめに調整 */
  font-weight: 900;
  letter-spacing: 0.05em;
  animation: bounce 2s infinite;
  display: inline-block;
}

/* バウンドアニメーション */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

/* ----------------------------------
 * アンケートフォームのスタイル
 * ---------------------------------- */
.survey-container {
  width: 100%;
  max-width: 380px;
  margin: 10px auto 20px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  flex-shrink: 0;
}

#survey-form {
  display: flex;
  flex-direction: column;
  gap: 28px; /* 質問カード同士の間隔を離す */
}

.question-block {
  background-color: var(--card-survey-bg);
  border-radius: 24px;
  padding: 28px 20px;
  box-shadow: 0 8px 25px rgba(220, 150, 160, 0.12);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.question-header {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.question-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 50px;
  background-color: #ffd5e5; /* 添付画像のような薄いピンクの六角形 */
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 700;
  color: #222222;
  flex-shrink: 0;
  padding-top: 1px;
}

.question-title {
  font-family: var(--font-ja);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.5;
  margin: 0;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-label {
  display: block;
  background-color: #ffffff; /* 添付画像のように未選択時は白 */
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.option-label input[type="radio"] {
  display: none; /* ラジオボタン本体は非表示 */
}

.option-text {
  font-family: var(--font-ja);
  font-size: 14px;
  font-weight: 700;
  color: #333333;
  line-height: 1.5;
  display: block;
}

/* 選択された選択肢のスタイル（CSS :has() を使用） */
.option-label:has(input:checked) {
  background-color: #fff0f3;
  border-color: var(--accent-pink);
  box-shadow: 0 4px 12px rgba(230, 0, 126, 0.12);
}

.option-label:has(input:checked) .option-text {
  color: var(--accent-pink);
}

/* 送信ボタン */
.submit-container {
  display: flex;
  justify-content: center;
  margin: 20px 0 40px;
}

.btn-submit {
  background-color: var(--primary-pink);
  color: #ffffff;
  font-family: var(--font-ja);
  font-size: 20px;
  font-weight: 900;
  border: none;
  border-radius: 50px;
  padding: 14px 0;
  width: 260px;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--primary-shadow), 0 10px 15px rgba(0, 0, 0, 0.12);
  transition: all 0.1s ease;
  outline: none;
}

.btn-submit:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--primary-shadow), 0 5px 8px rgba(0, 0, 0, 0.12);
}

.btn-submit:disabled {
  background-color: #d8d8d8; /* グレーアウト */
  color: #8c8c8c;
  box-shadow: none; /* 影をなくして平らにする */
  cursor: not-allowed;
  transform: none !important; /* タップ時の押し込みアニメーションを無効化 */
}

/* 未回答質問のアラートハイライト用 */
.question-block.error-highlight {
  border: 2px solid var(--accent-pink);
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}


/* ----------------------------------
 * 判定結果・感情選択画面のスタイル
 * ---------------------------------- */
#result-screen {
  align-items: center;
  justify-content: flex-start;
}

.result-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 380px;
  gap: 25px;
  margin: 10px auto;
}

.result-card {
  background-color: var(--card-bg);
  border-radius: 20px;
  width: 100%;
  padding: 35px 20px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(220, 150, 160, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.team-badge {
  background-color: var(--accent-pink);
  color: #ffffff;
  font-family: var(--font-en);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 4px 14px;
  border-radius: 50px;
}

.result-team-title {
  font-family: var(--font-ja);
  font-size: 20px;
  font-weight: 900;
  color: #222222;
  line-height: 1.6;
}

/* 感情選択コンテナ */
.emotion-container {
  background-color: var(--card-bg);
  border-radius: 20px;
  width: 100%;
  padding: 30px 16px;
  box-shadow: 0 10px 25px rgba(220, 150, 160, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.emotion-heading {
  font-family: var(--font-ja);
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-pink);
  letter-spacing: 0.05em;
}

.emotion-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.emotion-btn {
  background-color: #fbf5f6;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 16px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  outline: none;
}

.emotion-emoji {
  font-size: 28px;
}

.emotion-label-text {
  font-family: var(--font-ja);
  font-size: 13px;
  font-weight: 900;
  color: #333333;
}

.emotion-subtext {
  font-family: var(--font-ja);
  font-size: 10px;
  color: #777777;
  text-align: center;
  line-height: 1.3;
}

/* 感情選択時のハイライトとグレーアウト */
.emotion-btn.selected {
  background-color: #fff0f3;
  border-color: var(--accent-pink);
  box-shadow: 0 6px 15px rgba(230, 0, 126, 0.12);
  transform: scale(1.02);
}

.emotion-btn.selected .emotion-label-text {
  color: var(--accent-pink);
}

.emotion-btn.grayed-out {
  opacity: 0.35;
  filter: grayscale(80%);
  pointer-events: none; /* タップ不可 */
  transform: scale(0.95);
}

/* 自己開示メッセージ */
.disclosure-message-container {
  width: 100%;
  background-color: #fff0f3;
  border-left: 4px solid var(--accent-pink);
  border-radius: 8px;
  padding: 16px;
  margin-top: 10px;
  display: none; /* 初期状態は非表示 */
  animation: fadeInUp 0.4s ease forwards;
}

.disclosure-message {
  font-family: var(--font-ja);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-pink);
  line-height: 1.6;
  text-align: center;
}

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

/* ----------------------------------
 * 回答履歴エリアのスタイル
 * ---------------------------------- */
.history-container {
  width: 100%;
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeInUp 0.6s ease forwards;
}

.history-divider {
  border: none;
  border-top: 2px dashed #fbc6d0; /* パステルピンク寄りの点線 */
  margin: 10px 0;
}

.history-heading {
  font-family: var(--font-ja);
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-pink);
  text-align: center;
  letter-spacing: 0.05em;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin-bottom: 20px;
}

.history-card {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 4px 12px rgba(220, 150, 160, 0.06);
  border: 1px solid #fdf5f6;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease;
}

.history-card:hover {
  transform: translateY(-2px);
}

.history-q-title {
  font-family: var(--font-ja);
  font-size: 13px;
  color: #64748b; /* 上品なグレー */
  line-height: 1.4;
  font-weight: 700;
}

.history-a-text {
  font-family: var(--font-ja);
  font-size: 15px;
  color: #0f172a; /* 濃いメインカラー */
  font-weight: 700;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.history-a-icon {
  color: #10b981; /* 落ち着いたチェックマーク用グリーン */
  font-weight: 900;
  flex-shrink: 0;
}
