/* ============================================================
   Chaos me! - 共通スタイル
   ============================================================
   - 全CSSは .chaos-me 配下にスコープ限定（既存WPテーマと衝突しない）
   - 絵文字はテキスト内のみ。ボタン・要素装飾には使わない。
   - フォント：Zen Maru Gothic（テンプレート側でGoogle Fontsから読み込み）
   ============================================================ */


/* ============================================================
   1. デザイントークン・ルートスコープ
   ============================================================ */

.chaos-me {
  /* === デザイントークン === */
  --c-bg:        #FFFEF7;
  --c-text:      #3D3D5C;
  --c-text-soft: #6B6B8A;
  --c-yellow:    #E7F88E;
  --c-pink:      #FFD1DC;
  --c-pink-h:    #FF9AA8;
  --c-blue:      #B5E8F7;
  --c-blue-h:    #7FB8E8;
  --c-mint:      #C8F0D2;
  --c-cream:     #FFF5D6;
  --c-purple:    #D9C7F0;

  /* 5元素カラー */
  --el-wood: #A8D8A8;
  --el-fire: #FF9AA8;
  --el-earth:#E8C58E;
  --el-gold: #F5D76E;
  --el-water:#7FB8E8;

  /* シャドウ・線 */
  --border-w:    3px;

  /* タイポ */
  font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', sans-serif;
  color: var(--c-text);
  line-height: 1.7;
  letter-spacing: 0.04em;

  /* レイアウト */
  max-width: 480px;
  margin: 0 auto;
  background: var(--c-bg);
  min-height: auto;
  padding: 20px 20px 12px;
  box-sizing: border-box;
  position: relative;
  overflow-x: hidden;
}

@media (min-width: 600px) {
  body.has-chaos {
    background:
      radial-gradient(ellipse at top left, #FFD1DC22, transparent 50%),
      radial-gradient(ellipse at bottom right, #B5E8F722, transparent 50%),
      #FFFEF7;
  }
}

.chaos-me *,
.chaos-me *::before,
.chaos-me *::after {
  box-sizing: border-box;
}


/* ============================================================
   2. タイトル / ヘッダー
   ============================================================ */

.cm-title-wrap {
  text-align: center;
  margin-bottom: 4px;
}
.cm-title {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--c-text);
  margin: 0;
  display: inline-block;
  position: relative;
  text-shadow: 3px 3px 0 var(--c-pink), 6px 6px 0 var(--c-yellow);
  transform: rotate(-2deg);
  padding: 0 8px;
}
.cm-title .dot {
  display: inline-block;
  color: var(--c-pink-h);
  animation: cm-dot-bounce 1.6s ease-in-out infinite;
}
.cm-title--logo {
  display: block;
  width: 100%;
  padding: 0;
  line-height: 0;
  margin-bottom: -30px;
  text-shadow: none;
  transform: none;
}
.cm-title-logo {
  display: block;
  width: min(62vw, 240px);
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}
@keyframes cm-dot-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.cm-poweredby {
  text-align: center;
  font-size: 10px;
  color: var(--c-text-soft);
  letter-spacing: 0.18em;
  margin-top: 0;
  margin-bottom: 12px;
}
.cm-poweredby::before,
.cm-poweredby::after {
  content: '✦';
  margin: 0 6px;
  color: var(--c-pink-h);
}


/* ============================================================
   3. ボタン（共通）
   ============================================================ */

.cm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 28px;
  background: var(--c-pink-h);
  color: white;
  border: var(--border-w) solid var(--c-text);
  border-radius: 16px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
  max-width: 320px;
}
.cm-btn:hover {
  transform: translate(-1px, -1px);
}
.cm-btn:active {
  transform: translate(1px, 1px);
}

.cm-btn--primary { background: var(--c-purple); color: var(--c-text); }
.cm-btn--pink   { background: var(--c-pink-h); color: white; }
.cm-btn--yellow { background: var(--c-yellow); color: var(--c-text); }
.cm-btn--blue   { background: var(--c-blue-h); color: white; }
.cm-btn--mint   { background: var(--c-mint);   color: var(--c-text); }
.cm-btn--cream  { background: var(--c-cream);  color: var(--c-text); }
.cm-btn--purple { background: #B59CE0; color: white; }

.cm-btn--ghost {
  background: white;
  color: var(--c-text-soft);
  font-weight: 700;
  border-color: var(--c-text-soft);
}

.cm-btn--small {
  padding: 11px 18px;
  font-size: 13px;
  max-width: 200px;
  letter-spacing: 0.05em;
}

.cm-btn-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}
.chaos-me > .cm-btn-stack:last-child,
.chaos-me > .cm-stagger > .cm-btn-stack:last-child {
  margin-bottom: 0;
}


/* ============================================================
   4. カード / セクション（ベース）
   ============================================================ */

.cm-card {
  background: white;
  border: var(--border-w) solid var(--c-text);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
}
.cm-card--yellow { background: var(--c-yellow); }
.cm-card--pink   { background: var(--c-pink); }
.cm-card--blue   { background: var(--c-blue); }
.cm-card--mint   { background: var(--c-mint); }
.cm-card--cream  { background: var(--c-cream); }

.cm-section-label {
  display: inline-block;
  background: var(--c-text);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}


/* ============================================================
   5. キャラクター表示
   ============================================================ */

.cm-character {
  text-align: center;
  margin: 16px 0 12px;
}
.cm-character-svg {
  display: block;
  width: 240px;
  height: 240px;
  margin: 0 auto;
  animation: cm-float 3.5s ease-in-out infinite;
}
@keyframes cm-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-10px) rotate(1deg); }
}

.cm-character-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 10px;
  background: white;
  border: 2px solid var(--c-text);
  border-radius: 8px;
  margin-top: 4px;
}
.cm-character-label.elem-gold  { background: var(--el-gold); }
.cm-character-label.elem-fire  { background: var(--el-fire); color: white; }
.cm-character-label.elem-water { background: var(--el-water); color: white; }
.cm-character-label.elem-wood  { background: var(--el-wood); }
.cm-character-label.elem-earth { background: var(--el-earth); }

.cm-greeting {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin: 16px 0 8px;
  position: relative;
  display: block;
}
.cm-greeting .nick {
  background: linear-gradient(transparent 60%, var(--c-yellow) 60%);
  padding: 0 4px;
}


/* ============================================================
   6. 診断説明（トップページ）
   ============================================================ */

.cm-intro {
  background: white;
  border: var(--border-w) dashed var(--c-pink-h);
  border-radius: 20px;
  padding: 24px 20px;
  font-size: 14px;
  line-height: 1.9;
  margin: 24px 0 28px;
  text-align: center;
  position: relative;
}
.cm-intro strong {
  color: var(--c-pink-h);
  font-weight: 900;
}
.cm-intro small {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--c-text-soft);
}


/* ============================================================
   7. ローディング・エラー（共通カード）
   ============================================================ */

.cm-loading {
  text-align: center;
  padding: 40px 20px;
}

.cm-loading-icon {
  font-size: 56px;
  display: inline-block;
  animation: cm-pulse 1.4s ease-in-out infinite;
  transition: opacity 0.25s;
}
@keyframes cm-pulse {
  0%, 100% { transform: scale(1) rotate(-5deg); }
  50%      { transform: scale(1.25) rotate(5deg); }
}
.cm-loading-text {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--c-text);
  min-height: 1.7em;
}
.cm-loading-dots {
  display: inline-block;
  width: 1.5em;
  text-align: left;
}
.cm-loading-dots::after {
  content: '';
  animation: cm-dots 1.2s steps(4, end) infinite;
}
@keyframes cm-dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}
#loading-msg, #loading-icon {
  display: inline-block;
  transition: opacity 0.25s;
}


/* --- エラーカード (result/compat共用) --- */


.cm-error-card {
  background: var(--c-cream);
  border: var(--border-w) solid var(--c-text);
  border-radius: 24px;
  padding: 32px 22px 28px;
  margin-bottom: 24px;
  text-align: center;
}
.cm-error-icon {
  font-size: 56px;
  display: block;
  margin: 0 auto 12px;
  animation: cm-pulse 1.8s ease-in-out infinite;
}
.cm-error-title {
  font-size: 20px;
  font-weight: 900;
  margin: 0 0 16px;
  line-height: 1.4;
}
.cm-error-body {
  font-size: 14px;
  line-height: 1.85;
  font-weight: 700;
  margin: 0 0 20px;
}
.cm-error-card .cm-btn { margin: 0 auto; }


/* ============================================================
   9. アニメーション
   ============================================================ */

.cm-fade-in { animation: cm-fade-in 0.5s ease-out; }
@keyframes cm-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cm-stagger > * { opacity: 0; animation: cm-fade-in 0.5s ease-out forwards; }
.cm-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.cm-stagger > *:nth-child(2) { animation-delay: 0.15s; }
.cm-stagger > *:nth-child(3) { animation-delay: 0.25s; }
.cm-stagger > *:nth-child(4) { animation-delay: 0.35s; }
.cm-stagger > *:nth-child(5) { animation-delay: 0.45s; }
.cm-stagger > *:nth-child(6) { animation-delay: 0.55s; }
.cm-stagger > *:nth-child(7) { animation-delay: 0.65s; }


/* ============================================================
   10. MBTI質問ページ（プログレスバー・質問カード・5択）
   ============================================================ */

.cm-progress-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; margin-bottom: 6px; font-weight: 700;
  color: var(--c-text-soft); letter-spacing: 0.1em;
}
.cm-progress { margin-bottom: 36px; }
.cm-progress-meta .cur { color: var(--c-pink-h); font-size: 14px; font-weight: 900; }
.cm-progress-bar {
  height: 14px; background: white; border: 2px solid var(--c-text);
  border-radius: 999px; overflow: hidden;
}
.cm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-pink-h), var(--c-purple));
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 質問カード */
.cm-question-card {
  background: white; border: var(--border-w) solid var(--c-text);
  border-radius: 24px; padding: 32px 22px 28px; margin-bottom: 28px;
  position: relative; min-height: 130px;
  display: flex; align-items: center; justify-content: center;
}
.cm-question-card::before {
  content: 'Q'; position: absolute; top: -18px; left: 16px;
  width: 36px; height: 36px; background: var(--c-yellow);
  border: var(--border-w) solid var(--c-text); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 18px;
}
.cm-question-text {
  font-size: 19px; font-weight: 700; text-align: center;
  line-height: 1.65; margin: 0;
}

/* 5択ラジオ */
.cm-choices {
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
/* 5択ボタン共通スタイル */
.cm-choice {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  max-width: 320px;
  border: var(--border-w) solid var(--c-text); border-radius: 14px;
  padding: 14px 18px; cursor: pointer;
  font-weight: 900; font-size: 17px; letter-spacing: 0.05em;
  background: white; color: var(--c-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  font-family: inherit;
}
.cm-choice:hover { transform: translate(-1px, -1px); }
.cm-choice:active { transform: translate(1px, 1px); }
.cm-choice.is-selected { outline: 3px solid var(--c-yellow); outline-offset: 2px; }

/* グラデーション色：肯定強→否定強。サイズは全て統一 */
.cm-choice--p2 { background: #B5E8F7; }
.cm-choice--p1 { background: #DDF1FA; }
.cm-choice--n  { background: #FAFAF6; }
.cm-choice--m1 { background: #FFE5EB; }
.cm-choice--m2 { background: #FFD1DC; }

.cm-back-wrap { text-align: center; margin-top: 56px; }

/* フォーム */
.cm-form-section {
  background: white; border: var(--border-w) solid var(--c-text);
  border-radius: 24px; padding: 24px 20px;
  margin-bottom: 20px;
}
.cm-form-row { margin-bottom: 18px; }
.cm-form-row:last-child { margin-bottom: 0; }
.cm-form-label {
  display: block; font-weight: 900; font-size: 14px;
  margin-bottom: 6px; color: var(--c-text);
}
.cm-form-label .req { color: var(--c-pink-h); font-size: 11px; margin-left: 4px; }
.cm-form-hint { font-size: 11px; color: var(--c-text-soft); margin-top: 4px; font-weight: 500; }

.cm-input, .cm-select {
  width: 100%;
  height: 48px;
  min-height: 48px;
  padding: 11px 14px;
  border: 2px solid var(--c-text); border-radius: 12px;
  font-family: inherit; font-size: 16px; font-weight: 700;
  line-height: 1.4;
  background: var(--c-cream); color: var(--c-text); letter-spacing: 0.04em;
  box-sizing: border-box; outline: none;
  transition: box-shadow 0.15s ease;
  -webkit-appearance: none; appearance: none;
}
.cm-input:focus, .cm-select:focus {
  background: white; box-shadow: 3px 3px 0 var(--c-pink-h);
}
.cm-select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%233D3D5C' stroke-width='2' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  text-align: center;
  text-align-last: center;
}
.cm-input--error { border-color: var(--c-pink-h); background: #FFE5EB; }
.cm-error-msg { color: var(--c-pink-h); font-size: 12px; font-weight: 700; margin-top: 4px; }

.cm-name-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.cm-name-grid > *,
.cm-birth-grid > * {
  min-width: 0;
}

.cm-birth-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px;
}

.cm-blood-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.cm-blood-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 4px;
  border: 2px solid var(--c-text); border-radius: 12px;
  background: white; color: var(--c-text); font-family: inherit;
  font-weight: 900; font-size: 16px; line-height: 1.2; text-align: center; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cm-blood-btn:hover { transform: translate(-1px, -1px); }
.cm-blood-btn.is-selected { background: var(--c-yellow); }

@media (max-width: 390px) {
  .cm-form-section {
    padding: 20px 16px;
  }
  .cm-name-grid,
  .cm-birth-grid,
  .cm-blood-grid {
    gap: 6px;
  }
  .cm-input,
  .cm-select {
    padding-left: 10px;
    padding-right: 10px;
  }
  .cm-select {
    background-position: right 10px center;
    padding-right: 30px;
  }
  .cm-blood-btn {
    font-size: 15px;
    padding-left: 2px;
    padding-right: 2px;
  }
}

/* ============================================================
   12. 診断結果カード（4カテゴリ）
   ============================================================ */

.cm-result-section {
  margin-top: 28px;
}
.cm-result-card {
  border: var(--border-w) solid var(--c-text);
  border-radius: 24px;
  padding: 22px 18px 20px;
  margin-bottom: 18px;
  position: relative;
}
.cm-result-card--general { background: var(--c-mint); }
.cm-result-card--work    { background: var(--c-blue); }
.cm-result-card--love    { background: var(--c-pink); }
.cm-result-card--life    { background: var(--c-yellow); }

.cm-result-cat {
  display: inline-block;
  background: white;
  border: 2.5px solid var(--c-text);
  border-radius: 999px;
  padding: 4px 18px;
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}

.cm-result-text {
  font-size: 14.5px;
  line-height: 1.85;
  font-weight: 500;
  margin: 0;
  white-space: pre-wrap;
}


/* ============================================================
   13. シェアボタン（X / LINE / リンクコピー）
   ============================================================ */

.cm-share-section {
  margin-top: 24px;
  text-align: center;
}
.cm-section-heading {
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.18em;
  color: var(--c-text-soft);
  margin: 0 0 14px;
  text-align: center;
}
.cm-share-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 10px;
}
.cm-share-btn {
  padding: 14px 8px;
  background: white;
  border: var(--border-w) solid var(--c-text);
  border-radius: 16px;
  font-family: inherit;
  font-weight: 900;
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.2;
}
.cm-share-btn:hover { transform: translate(-1px, -1px); }
.cm-share-btn:active { transform: translate(1px, 1px); }
.cm-share-btn--x { background: #4A4A5C; color: white; border-color: #2A2A38; }
.cm-share-btn--x .icon { color: white; }
.cm-share-btn--line { background: #06C755; color: white; border-color: #054220; }
.cm-share-btn--copy { background: #F2D24F; color: var(--c-text); }
.cm-share-btn .icon {
  width: 20px; height: 20px; display: block;
}
.cm-share-btn .label {
  font-size: 12px; font-weight: 900;
}


/* ============================================================
   14. 相性診断ボタン（縦長アイコン付き 3つ）
   ============================================================ */

.cm-compat-section {
  margin-top: 24px;
}
.cm-compat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.cm-compat-btn {
  padding: 16px 6px;
  background: white;
  border: var(--border-w) solid var(--c-text);
  border-radius: 18px;
  font-family: inherit;
  font-weight: 900;
  font-size: 11.5px;
  color: var(--c-text);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1.3;
  text-align: center;
  min-height: 88px;
}
.cm-compat-btn:hover { transform: translate(-1px, -1px); }
.cm-compat-btn:active { transform: translate(1px, 1px); }
.cm-compat-btn--main { background: var(--c-blue); }
.cm-compat-btn--paste { background: var(--c-cream); }
.cm-compat-btn--history { background: var(--c-pink); }
.cm-compat-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: white;
  border: 2px solid var(--c-text);
  border-radius: 50%;
  flex-shrink: 0;
}
.cm-compat-icon svg { width: 18px; height: 18px; }


/* ============================================================
   15. モーダル（共通）→ 詳細はセクション26へ
   ============================================================ */
@keyframes cm-pop-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}


/* ============================================================
   16. 今日のアドバイス：気分5択・すること4択
   ============================================================ */

.cm-section-q {
  text-align: center;
  margin: 24px 0 14px;
}
.cm-section-q-text {
  display: inline-block;
  font-size: 19px;
  font-weight: 900;
  background: var(--c-yellow);
  border: var(--border-w) solid var(--c-text);
  border-radius: 999px;
  padding: 8px 22px;
  transform: rotate(-1deg);
}


.cm-mood-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.cm-mood-btn {
  padding: 12px 4px;
  background: white;
  border: 2.5px solid var(--c-text);
  border-radius: 14px;
  font-family: inherit;
  font-weight: 900;
  font-size: 11px;
  color: var(--c-text);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
}
.cm-mood-btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
}
.cm-mood-btn:active:not(:disabled) {
  transform: translate(1px, 1px);
}
.cm-mood-btn.is-selected {
  background: var(--c-blue);
}
.cm-mood-btn:disabled { cursor: default; opacity: 0.65; }


.cm-act-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.cm-act-btn {
  padding: 16px 12px;
  background: white;
  border: var(--border-w) solid var(--c-text);
  border-radius: 16px;
  font-family: inherit;
  font-weight: 900;
  font-size: 16px;
  color: var(--c-text);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  text-align: center;
  letter-spacing: 0.05em;
}
.cm-act-btn:hover:not(:disabled) {
  transform: translate(-1px, -1px);
}
.cm-act-btn:active:not(:disabled) {
  transform: translate(1px, 1px);
}
.cm-act-btn.is-selected {
  background: var(--c-mint);
}
.cm-act-btn:disabled { cursor: default; opacity: 0.65; }


/* ============================================================
   17. アドバイス吹き出し
   ============================================================ */

.cm-advice-bubble {
  background: var(--c-cream);
  border: var(--border-w) solid var(--c-text);
  border-radius: 28px;
  padding: 24px 22px;
  position: relative;
  margin-top: 32px;
  text-align: center;
  /* 結果表示・ローディング・エラーすべてで同じ高さに固定 */
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* 吹き出しのしっぽ（上向き、中央寄り） */
.cm-advice-bubble::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 24px;
  height: 24px;
  background: var(--c-cream);
  border-left: var(--border-w) solid var(--c-text);
  border-top: var(--border-w) solid var(--c-text);
  border-right: 0;
  border-bottom: 0;
}

/* 結果表示用の中身 */
.cm-bubble-result {
  width: 100%;
}
.cm-advice-text {
  font-size: 15px;
  line-height: 1.85;
  font-weight: 700;
  margin: 0;
  white-space: pre-wrap;
  text-align: left;
}
.cm-advice-meta {
  font-size: 11px;
  color: var(--c-text-soft);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1.5px dashed var(--c-text-soft);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
}

/* ローディング状態の吹き出し中身 */
.cm-bubble-loading {
  text-align: center;
  width: 100%;
}
.cm-bubble-loading-icon {
  font-size: 44px;
  display: block;
  margin: 0 auto 14px;
  animation: cm-pulse 1.5s ease-in-out infinite;
}
.cm-bubble-loading-title {
  font-size: 17px;
  font-weight: 900;
  margin: 0 0 8px;
}
.cm-bubble-loading-sub {
  font-size: 13px;
  color: var(--c-text-soft);
  font-weight: 700;
  margin: 0;
}

/* エラー状態の吹き出し中身 */
.cm-bubble-error {
  text-align: center;
  width: 100%;
}
.cm-bubble-error-icon {
  font-size: 32px;
  display: block;
  margin: 0 auto 6px;
  animation: cm-pulse 1.5s ease-in-out infinite;
}
.cm-bubble-error-title {
  font-size: 16px;
  font-weight: 900;
  margin: 0 0 8px;
  line-height: 1.4;
}
.cm-bubble-error-body {
  font-size: 13px;
  line-height: 1.7;
  font-weight: 700;
  margin: 0 0 14px;
}


.cm-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 18px;
}
.cm-summary-tag {
  background: white;
  border: 2px solid var(--c-text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.05em;
}
.cm-summary-tag .lbl { color: var(--c-text-soft); margin-right: 6px; }


/* ============================================================
   18. キャラクター表示（小さめ・アドバイスページ用）
   ============================================================ */

.cm-character-mini-wrap {
  text-align: center;
  margin-bottom: 18px;
}
.cm-character-mini {
  display: block;
  width: 140px;
  height: 140px;
  margin: 0 auto 8px;
  animation: cm-float 3.5s ease-in-out infinite;
}
@keyframes cm-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-6px) rotate(1deg); }
}
.cm-character-mini-label {
  display: inline-block;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 10px;
  background: var(--el-gold);
  border: 2px solid var(--c-text);
  border-radius: 8px;
}
.cm-character-mini-label.elem-fire  { background: var(--el-fire); color: white; }
.cm-character-mini-label.elem-water { background: var(--el-water); color: white; }
.cm-character-mini-label.elem-wood  { background: var(--el-wood); }
.cm-character-mini-label.elem-earth { background: var(--el-earth); }
.cm-character-mini-label.elem-gold  { background: var(--el-gold); }


/* ============================================================
   19. 相性診断：2人の対面エリア
   ============================================================ */

.cm-vs-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2px;
  align-items: center;
  margin-bottom: 8px;
  position: relative;
}
.cm-vs-person {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cm-vs-character-svg {
  width: 56px;
  height: 56px;
  display: block;
  animation: cm-float 3.5s ease-in-out infinite;
}
.cm-vs-person--right .cm-vs-character-svg {
  animation-delay: 0.5s;
  animation-name: cm-float-mirror;
}
@keyframes cm-float {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-6px) rotate(2deg); }
}
@keyframes cm-float-mirror {
  0%, 100% { transform: translateY(0) rotate(2deg); }
  50%      { transform: translateY(-6px) rotate(-2deg); }
}
.cm-vs-name {
  font-size: 12px;
  font-weight: 900;
  margin: 0;
  letter-spacing: 0.05em;
  word-break: break-all;
  line-height: 1.2;
}
.cm-vs-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 900;
  padding: 2px 5px;
  background: var(--el-gold);
  border: 1.5px solid var(--c-text);
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cm-vs-badge.elem-fire  { background: var(--el-fire); color: white; }
.cm-vs-badge.elem-water { background: var(--el-water); color: white; }
.cm-vs-badge.elem-wood  { background: var(--el-wood); }
.cm-vs-badge.elem-earth { background: var(--el-earth); }
.cm-vs-badge.elem-gold  { background: var(--el-gold); }

/* 真ん中の×マーク（点線で繋ぐのではなく、×だけ） */
.cm-vs-link {
  position: relative;
  width: 22px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cm-vs-link-mark {
  font-size: 17px;
  font-weight: 900;
  color: var(--c-text);
  line-height: 1;
}


/* ============================================================
   20. 相性診断：結果カード（4カテゴリ）
   ============================================================ */


.cm-compat-card {
  border: var(--border-w) solid var(--c-text);
  border-radius: 24px;
  padding: 22px 18px 20px;
  margin-bottom: 18px;
}
.cm-compat-card--work    { background: var(--c-blue); }
.cm-compat-card--friend  { background: var(--c-mint); }
.cm-compat-card--love    { background: var(--c-pink); }
.cm-compat-card--chaos   { background: var(--c-purple); }

.cm-compat-cat {
  display: inline-block;
  background: white;
  border: 2.5px solid var(--c-text);
  border-radius: 999px;
  padding: 4px 18px;
  font-weight: 900;
  font-size: 16px;
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}
.cm-compat-text {
  font-size: 14.5px;
  line-height: 1.85;
  font-weight: 500;
  margin: 0;
  white-space: pre-wrap;
}


/* ============================================================
   21. 相性診断履歴
   ============================================================ */

.cm-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.cm-history-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 8px 32px 8px 8px;
  background: white;
  border: var(--border-w) solid var(--c-text);
  border-radius: 18px;
  color: var(--c-text);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.cm-history-item:hover {
  transform: translate(-1px, -1px);
}
.cm-history-item:active {
  transform: translate(1px, 1px);
}
.cm-history-item:focus-visible {
  outline: 3px solid var(--c-blue-h);
  outline-offset: 3px;
}
.cm-history-vs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  gap: 2px;
  align-items: center;
}
.cm-history-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 0;
  text-align: center;
}
.cm-history-character {
  display: block;
  width: 46px;
  height: 46px;
  object-fit: contain;
}
.cm-history-name {
  margin: 0;
  font-size: 10px;
  font-weight: 900;
  word-break: break-all;
  line-height: 1.3;
}
.cm-history-elem-tag {
  display: inline-block;
  max-width: 100%;
  font-size: 8px;
  font-weight: 900;
  line-height: 1.25;
  padding: 1px 5px;
  background: var(--el-gold);
  border: 1.5px solid var(--c-text);
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cm-history-elem-tag.elem-fire  { background: var(--el-fire); color: white; }
.cm-history-elem-tag.elem-water { background: var(--el-water); color: white; }
.cm-history-elem-tag.elem-wood  { background: var(--el-wood); }
.cm-history-elem-tag.elem-earth { background: var(--el-earth); }
.cm-history-elem-tag.elem-gold  { background: var(--el-gold); }

.cm-history-link {
  width: 22px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cm-history-link-mark {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  background: var(--c-yellow);
  border: 2px solid var(--c-text);
  border-radius: 50%;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}
.cm-history-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}
.cm-history-meta {
  margin: 0;
  font-size: 9px;
  color: var(--c-text-soft);
  font-weight: 700;
  letter-spacing: 0.05em;
}
.cm-history-open {
  display: inline-block;
  font-size: 9px;
  font-weight: 900;
  color: var(--c-pink-h);
  letter-spacing: 0.06em;
}

.cm-history-delete {
  position: absolute;
  right: 5px;
  bottom: 5px;
  background: white;
  border: 2px solid var(--c-text-soft);
  color: var(--c-text-soft);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s ease;
  line-height: 1;
  z-index: 2;
}
.cm-history-delete:hover {
  transform: scale(1.1);
  background: var(--c-pink-h); color: white; border-color: var(--c-text);
}

.cm-history-empty {
  text-align: center;
  padding: 40px 20px;
  background: var(--c-cream);
  border: var(--border-w) dashed var(--c-text-soft);
  border-radius: 24px;
  margin-top: 20px;
}
.cm-history-empty-icon {
  font-size: 44px;
  display: block; margin: 0 auto 12px;
}
.cm-history-empty-text {
  font-size: 14px; font-weight: 700;
  margin: 0; line-height: 1.7;
  color: var(--c-text-soft);
}

.cm-history-bulk {
  text-align: center;
  margin-top: 16px;
}

@media (max-width: 480px) {
  .cm-title-logo {
    width: min(58vw, 205px);
  }

  .cm-vs-row {
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 1px;
    margin-bottom: 8px;
  }
  .cm-vs-person {
    gap: 1px;
    min-width: 0;
  }
  .cm-vs-character-svg {
    width: 42px;
    height: 42px;
    animation: none;
  }
  .cm-vs-name {
    max-width: 100%;
    font-size: 11px;
    line-height: 1.2;
    word-break: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cm-vs-badge {
    display: none;
  }
  .cm-vs-link {
    width: 18px;
    height: 42px;
  }
  .cm-vs-link-mark {
    font-size: 14px;
  }

  .cm-history-list {
    gap: 8px;
    margin-top: 10px;
  }
  .cm-history-item {
    padding: 8px 28px 8px 8px;
  }
  .cm-history-vs {
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 1px;
  }
  .cm-history-side {
    gap: 1px;
  }
  .cm-history-character {
    width: 38px;
    height: 38px;
  }
  .cm-history-name {
    max-width: 100%;
    font-size: 10px;
    line-height: 1.2;
    word-break: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cm-history-elem-tag,
  .cm-history-footer {
    display: none;
  }
  .cm-history-link {
    width: 18px;
    min-height: 38px;
  }
  .cm-history-link-mark {
    width: 18px;
    height: 18px;
    font-size: 12px;
    border-width: 1.5px;
  }
  .cm-history-delete {
    right: 5px;
    bottom: 5px;
    width: 22px;
    height: 22px;
    font-size: 13px;
  }
}


/* ============================================================
   22. 注意書き
   ============================================================ */

.cm-notice {
  margin-top: 20px;
  background: var(--c-cream);
  border: 2px dashed var(--c-text-soft);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--c-text-soft);
  text-align: center;
  line-height: 1.6;
}

/* ============================================================
   23. トースト通知（コピー成功などの軽い通知）
   ============================================================ */
.cm-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: white;
  color: var(--c-text);
  padding: 12px 24px;
  border: 2px solid var(--c-text);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.25s ease;
  font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', sans-serif;
  white-space: nowrap;
}
.cm-toast.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* モーダル展開中はbodyスクロールを止める */
body.cm-modal-open {
  overflow: hidden;
}


/* ============================================================
   24. 診断結果ページ：キャラ名（大きめ）・ヘッダー
   ============================================================ */
.cm-result-header {
  text-align: center;
  margin: 8px 0 18px;
}
.cm-character-label-big {
  display: inline-block;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 10px;
  background: var(--el-gold);
  border: 2px solid var(--c-text);
  border-radius: 8px;
  letter-spacing: 0.03em;
  color: var(--c-text);
}
.cm-character-label-big.elem-fire  { background: var(--el-fire);  color: white; }
.cm-character-label-big.elem-water { background: var(--el-water); color: white; }
.cm-character-label-big.elem-wood  { background: var(--el-wood); }
.cm-character-label-big.elem-earth { background: var(--el-earth); }
.cm-character-label-big.elem-gold  { background: var(--el-gold); }

/* ============================================================
   25. ローディング詳細パーツ（spinner・msg・sub）
   ============================================================ */
.cm-loading-spinner {
  display: inline-block;
  width: 56px;
  height: 56px;
  border: 5px solid var(--c-cream);
  border-top-color: var(--c-pink-h);
  border-radius: 50%;
  animation: cm-spin 0.9s linear infinite;
}
@keyframes cm-spin {
  to { transform: rotate(360deg); }
}
.cm-loading-msg {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 800;
  color: var(--c-text);
  min-height: 1.7em;
  letter-spacing: 0.04em;
}
.cm-loading-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--c-text-soft);
  font-weight: 600;
}

/* ============================================================
   26. モーダル（新構造：cm-modal > cm-modal-backdrop + cm-modal-card）
   ============================================================ */
.cm-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cm-modal.is-shown { display: flex; }
.cm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(61, 61, 92, 0.5);
}
.cm-modal-card {
  position: relative;
  background: white;
  border: 3px solid var(--c-text);
  border-radius: 18px;
  padding: 18px 22px 20px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  font-family: 'Zen Maru Gothic', 'Hiragino Maru Gothic ProN', sans-serif;
  color: var(--c-text);
  animation: cm-fade-in 0.2s ease-out;
}
.cm-modal-title {
  font-size: 19px;
  font-weight: 900;
  margin: 0 0 8px;
}
.cm-modal-body {
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.cm-modal-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.cm-modal-card .cm-input { margin-bottom: 6px; }

/* ============================================================
   28. アドバイス補足テキスト
   ============================================================ */
.cm-advice-note {
  text-align: center;
  font-size: 11px;
  color: var(--c-text-soft);
  margin-top: 14px;
  letter-spacing: 0.05em;
  font-weight: 600;
}


/* ============================================================
   29. 「診断をやり直す」専用ボタン（白背景・黒文字・控えめ）
   ============================================================ */
.cm-btn--restart {
  background: white;
  color: var(--c-text);
  border-color: var(--c-text);
  font-weight: 800;
}
/* ============================================================
   30. モーダル内のURL入力（点線で枠と差別化）
   ============================================================ */
.cm-modal-card .cm-input {
  border-style: dashed;
  background: #FFFEF7;
  border-color: var(--c-text-soft);
  font-size: 14px;
  padding: 10px 12px;
}
.cm-modal-card .cm-input:focus {
  border-style: solid;
}


/* ============================================================
   31. 「自分のChaosを見る」専用ボタン（濃いめ黄色）
   ============================================================ */
.cm-btn--gold {
  background: #F2D24F;
  color: var(--c-text);
}


/* ============================================================
   32. 「大丈夫！」など赤系の確定ボタン（やり直す確認用）
   ============================================================ */
.cm-btn--red {
  background: #FF6B6B;
  color: white;
  border-color: #C43A3A;
}
/* ============================================================
   33. MBTI質問エリア（重複削除で消えた分の復元）
   ============================================================ */
.cm-question-area {
  position: relative;
  min-height: 400px;
}
.cm-question-area > .question-block {
  animation: cm-fade-in 0.35s ease-out;
}


/* ============================================================
   34. GO!!ボタン専用：力強さの演出
   ============================================================ */
.cm-btn--go {
  font-size: 22px;
  letter-spacing: 0.18em;
  font-weight: 900;
}
/* small サイズと併用時は控えめに（モーダル内などで使用） */
.cm-btn--small.cm-btn--go,
.cm-btn--go.cm-btn--small {
  font-size: 16px;
  letter-spacing: 0.12em;
  padding: 11px 18px;
}
