:root {
  --accent: #FF85AD;
  --accent-light: #FFB3CC;
  --accent2: #FF85AD;
  --accent2-light: #FF85AD;
  --text: #333333;
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --font: "M PLUS Rounded 1c", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

ul {
  margin: 0;
  padding: 0;
}

.diagnosis-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
}

.screen {
  display: none;
  animation: fadeIn 0.5s ease;
}

.screen.active {
  display: block !important;
}

/* スタート画面とクイズ画面はカードとして表示 */
#screen-start, #screen-question, #screen-loading {
  background-color: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: 26px;
}

/* 結果画面は独立したカードにする */
#screen-result {
  margin-top: 16px;
}

/* 結果画面の各セクションをカード化 */
.result-card {
  background-color: var(--card-bg);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 26px;
}

.title-container {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
}

.title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 16px;
  font-weight: 700;
  color: #333;
  display: inline-block;
  line-height: 1.3;
}

.subtitle {
  text-align: center;
  font-size: 1rem;
  margin-bottom: 32px;
  color: #666;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
}

.input-name {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 1rem;
  transition: border-color 0.3s;
  font-family: var(--font);
}

.input-name:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s, opacity 0.2s;
  font-family: var(--font);
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  /* スマホでの拡大を防ぐための修正 */
  touch-action: manipulation;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.start-btn {
  background-color: var(--accent);
  color: #fff;
}

.back-btn {
  background-color: #f5f5f5;
  color: #666;
  margin-top: 24px;
  font-size: 1rem;
  border: 2px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.back-btn svg {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  flex-shrink: 0;
}

.back-btn:hover {
  background-color: #eeeeee;
  border-color: #cccccc;
}

.progress-wrapper {
  margin-bottom: 24px;
}

.progress-text {
  font-size: 0.9rem;
  margin-bottom: 8px;
  text-align: center;
  color: #666;
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: #eee;
  border-radius: 8px;
  overflow: hidden;
}

.progress-inner {
  width: 0%;
  height: 100%;
  background: var(--accent2);
  transition: width 0.3s ease;
}

.question {
  font-size: 1.2rem;
  margin-bottom: 32px;
  font-weight: 700;
  text-align: center;
  color: #333;
  line-height: 1.4;
  position: relative;
  padding-bottom: 10px;
}

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

.options .btn {
  background: #fff;
  border: 2px solid #eee;
  color: var(--text);
  text-align: left;
  position: relative;
  padding-right: 40px;
  font-weight: 500;
}

.options .btn::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
  opacity: 0.6;
}

.loading-wrapper {
  text-align: center;
  padding: 60px 0;
}

.loader {
  width: 60px;
  height: 60px;
  border: 6px solid #f0f0f0;
  border-top: 6px solid var(--accent);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.8;
}

.result-title {
  font-size: 1.4rem;
  text-align: center;
  margin-bottom: 16px;
  color: #333;
  font-weight: 700;
}

.result-type {
  font-size: 1.3rem;
  text-align: center;
  color: #FF85AD;
  margin-bottom: 16px;
  font-weight: 700;
  line-height: 1.4;
  padding: 16px;
  background-color: #fff5f8;
  border-radius: 12px;
}

#resultImage {
  display: block;
  max-width: 70%;
  height: auto;
  margin: 24px auto;
  border-radius: 12px;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#resultImage.loaded {
  opacity: 1;
  transform: scale(1);
}

.result-desc {
  font-size: 1.05rem;
  padding: 0 8px;
  margin-bottom: 32px;
  line-height: 1.8;
  color: #444;
}

/* セクションヘッダー */
.section-header {
  background-color:#fff5f8;
  color: #FF85AD;
  padding: 16px;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  border-radius: 16px;
  display: block;
  margin-bottom: 16px;
	margin-top: 5px;
}

/* セクションコンテンツ */
.section-content {
  padding: 0 8px;
}

.section-content ul {
  padding-left: 0;
  margin-bottom: 0;
}

.section-content li {
  list-style-type: none;
  margin-bottom: 10px;
  position: relative;
  padding-left: 20px;
}
.section-content li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FF85AD' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='icon icon-tabler icons-tabler-outline icon-tabler-check'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'/%3E%3Cpath d='M5 12l5 5l10 -10' /%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}
/* タグ用のスタイル */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.9rem;
    background: var(--accent2);
    color: #fff;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 1px;
}

.section-subtitle {
  font-weight: 600;
  font-size: 1rem;
  margin: 20px 0 10px 0;
  color: #333;
}

/* ボタンを縦並びにする */
.result-buttons {
  display: flex;
  flex-direction: column; /* 常に縦並び */
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 32px;
}

/* share-button-style クラスはHTMLから削除されるため、このCSSは実質影響なし */
.share-button-style {
  background: #1da1f2;
  color: #fff;
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s, opacity 0.2s;
  font-family: var(--font);
  text-decoration: none;
  text-align: center;
  display: block;
}

.restart-btn {
  background: var(--accent);
  color: #fff;
  width: 100%;
}

/* 履歴ボタンなどのユーティリティアイコンコンテナ */
.utility-icons {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column; /* HTMLの記述順に縦に並べる (トップアイコンが上、Xアイコンが真ん中、履歴アイコンが下) */
  gap: 16px; /* アイコン間のスペース */
  z-index: 10;
}

/* 各ユーティリティアイコンの共通スタイル */
.utility-icon {
  background: rgba(255, 255, 255);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  /* aタグの場合もボタンと同じスタイルを適用 */
  text-decoration: none;
  color: var(--text); /* 親要素の色 (var(--text)) をSVGがcurrentColorとして継承する */
}

.utility-icon svg {
  /* 各SVGアイコンの共通サイズ。個別の調整は下記で実施 */
  width: 32px;
  height: 32px;
}

/* XアイコンのSVGのサイズ調整 (視覚的に小さく見せるため) */
.utility-icons a.utility-icon:nth-child(2) svg { /* utility-icons内の2番目のa要素 (Xアイコン) */
  width: 28px; /* 履歴アイコンより少し小さく */
  height: 28px; /* 履歴アイコンより少し小さく */
}


/* モーダル */
.modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-container.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--card-bg);
  border-radius: 16px;
  padding: 18px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--text);
  font-size: 1.4rem;
  position: relative;
  padding-bottom: 10px;
}

.history-list {
  margin-bottom: 16px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 2px 12px 2px;
  border-bottom: 1px solid #eee;
  align-items: center;
}

.history-date {
  font-size: 1rem;
  color: #000000;
  width: 30px;
}

.history-name {
  font-weight: bold;
  flex: 1;
  margin: 0 10px;
}

.history-type {
  color: #FF85AD;
  font-size: 0.8rem;
  text-align: right;
  font-weight: 700;
}

.close-modal-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  margin-top: 16px;
}

/* パーソナライズされた紹介文 */
.personalized-intro {
  font-weight: 600;
  color: #333;
  background-color: #fff5f8;
  padding: 16px;
  margin-bottom: 20px;
  border-left: 4px solid #FF85AD;
  line-height: 1.5;
}

/* チャート用CSS */
.chart-container {
  margin: 32px 0;
  padding: 20px;
  background-color: #fff5f8;
  border-radius: 12px;
  border: 1px solid #ffddea;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.chart-container.animated {
  opacity: 1;
  transform: translateY(0);
}

.chart-title {
  text-align: center;
  margin: 0 0 20px 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #333;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  margin: 0 auto;
}

.chart-wrapper canvas {
  max-width: 100%;
  height: auto !important;
}

@media (max-width: 480px) {
  .chart-container {
    padding: 16px;
    margin: 24px 0;
  }

  .chart-title {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .diagnosis-container {
    padding: 12px;
  }

  .result-card {
    padding: 20px;
  }

  .title {
    font-size: 1.6rem;
  }

  .result-type {
    font-size: 1.2rem;
  }

  .result-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .share-button-style,
  .restart-btn {
    width: 100%;
  }

  #resultImage {
    max-width: 80%;
    margin: 20px auto;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* タッチデバイス対応 */
* {
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* ボタンのタップ効果をより自然に - 時間を調整 */
.btn {
  transition: background-color 0.3s ease, transform 0.1s ease !important;
}

.btn:active {
  background-color: #FFB3CC !important;
  transform: scale(0.96) !important;
  transition: background-color 0.15s ease-out, transform 0.1s ease-out !important;
}

/* スタートボタン用 */
.start-btn:active {
  background-color: #e76b96 !important;
}

/* 戻るボタン用 */
.back-btn:active {
  background-color: #dddddd !important;
  border-color: #aaaaaa !important;
}

/* 選択肢ボタン用 */
.options .btn:active {
  background-color: #ffe8f0 !important;
  border-color: #FF85AD !important;
}

/* ピンクのボーダーを消す */
.btn:focus {
  outline: none !important;
}

/* 追加：GPU高速化でスムーズなアニメーション */
.btn {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
a {
    text-decoration: none;
    transition: all ease .4s;
}

/* アフィリエイトリンクボタンのスタイル */
.affiliate-link-btn {
  background-color: #2db585;
  color: #fff;
  margin-bottom: 10px; /* 縦並びのためマージンを追加 */
  width: 100%; /* 親要素の幅に合わせて100%に */
  display: block; /* 常にブロック要素として縦並び */
}

.affiliate-link-btn:hover {
  background-color: #249d6f;
  transform: translateY(-2px);
}

.affiliate-link-btn:active {
  background-color: #1e875f !important;
  transform: scale(0.96) !important;
  transition: background-color 0.15s ease-out, transform 0.1s ease-out !important;
}

.affiliate-link-btn img {
    display: none;
}
.diagnosis_af
{
text-align: center;
    font-size: .8rem !important;
    letter-spacing: 1px;
}
