/* ============================================================
   ReCoA 恋愛タイプ診断 スタイル
   デザイン方針（仕様書9.5）：
   - 明朝体ベース、見出しのみ太いゴシック
   - 余白を多めに取る（読みやすさ＝信頼性）
   - タイプ別カラーはアクセントとして使用
   ============================================================ */

:root {
  --type-color: #c9485b; /* 結果表示時にJSで上書き */
  --r1: #c9485b;
  --r2: #4a6b8a;
  --r3: #d88fa3;
  --r4: #6b8e5a;
  --ink: #3a3633;
  --ink-light: #7a736d;
  --bg: #faf7f4;
  --card: #ffffff;
  --line: #e8e1da;
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", serif;
  --sans: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--serif);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, button {
  font-family: var(--sans);
  font-weight: 700;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

/* ---------- ヘッダー・フッター ---------- */
.site-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 1.1rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.25rem;
  letter-spacing: 0.08em;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--ink-light);
}

.site-footer {
  text-align: center;
  padding: 2rem 1rem 3rem;
  font-size: 0.75rem;
  color: var(--ink-light);
}

.privacy-note {
  margin-top: 0.4rem;
}

.noscript-note {
  max-width: 640px;
  margin: 0 auto 2rem;
  padding: 1rem 1.25rem;
  text-align: center;
  background: #fff3f0;
  color: var(--ink);
}

/* ---------- 画面切り替え ---------- */
.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: fadein 0.4s ease;
}

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

/* ---------- 導入画面 ---------- */
.intro-hero {
  text-align: center;
  padding-top: 2.5rem;
}

.intro-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  color: var(--ink-light);
  margin-bottom: 1.2rem;
}

.intro-hero h1 {
  font-size: 1.6rem;
  line-height: 1.7;
  margin-bottom: 1.6rem;
}

.intro-lead {
  font-size: 0.95rem;
  margin-bottom: 2.2rem;
}

.type-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.2rem;
}

.chip {
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  color: #fff;
}

.chip-r1 { background: var(--r1); }
.chip-r2 { background: var(--r2); }
.chip-r3 { background: var(--r3); }
.chip-r4 { background: var(--r4); }

.intro-meta {
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-bottom: 1.4rem;
}

/* ---------- 導入画面のSEOコンテンツ ---------- */
.intro-seo {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
  text-align: left;
}

.intro-seo h2 {
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.intro-seo-lead {
  font-size: 0.92rem;
  color: var(--ink-light);
  margin-bottom: 1.4rem;
}

.type-overview {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 2.6rem;
}

.type-overview article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.15rem;
}

.type-overview-name {
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.type-overview-name.type-r1 { color: var(--r1); }
.type-overview-name.type-r2 { color: var(--r2); }
.type-overview-name.type-r3 { color: var(--r3); }
.type-overview-name.type-r4 { color: var(--r4); }

.type-overview p {
  font-size: 0.9rem;
  line-height: 1.75;
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-list details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
}

.faq-list summary {
  font-family: var(--sans);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "＋";
  float: right;
  font-weight: 400;
  color: var(--ink-light);
}

.faq-list details[open] summary::after {
  content: "−";
}

.faq-list details p {
  margin-top: 0.7rem;
  font-size: 0.9rem;
  color: var(--ink-light);
}

/* ---------- ボタン ---------- */
.primary-button {
  display: inline-block;
  width: 100%;
  max-width: 360px;
  padding: 1rem 2rem;
  font-size: 1.05rem;
  color: #fff;
  background: var(--ink);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.primary-button:hover {
  opacity: 0.85;
}

.text-button {
  background: none;
  border: none;
  color: var(--ink-light);
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.5rem;
}

/* ---------- 属性入力画面 ---------- */
.screen-title {
  font-size: 1.25rem;
  margin-bottom: 0.8rem;
}

.screen-note {
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-bottom: 2rem;
}

fieldset {
  border: none;
  margin-bottom: 2rem;
}

legend {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

.required, .optional {
  font-size: 0.7rem;
  font-weight: 400;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.required {
  color: #fff;
  background: var(--r1);
}

.optional {
  color: var(--ink-light);
  background: var(--line);
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.radio-group label {
  cursor: pointer;
}

.radio-group input {
  position: absolute;
  opacity: 0;
}

.radio-group span {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  transition: all 0.15s;
}

.radio-group input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.radio-group input:focus-visible + span {
  outline: 2px solid var(--r2);
  outline-offset: 2px;
}

/* ---------- 設問画面 ---------- */
.question-header {
  margin-bottom: 2.2rem;
}

#q-counter {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-light);
  display: block;
  margin-bottom: 0.6rem;
}

.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: var(--ink);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.8;
  min-height: 4.2em;
  margin-bottom: 2rem;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 2rem;
}

.choice-btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.9rem 1.1rem;
  font-size: 0.95rem;
  text-align: left;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.choice-btn:hover {
  border-color: var(--ink);
}

.choice-btn.selected {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.choice-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ---------- 警告オーバーレイ ---------- */
.warning-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58, 54, 51, 0.55);
  z-index: 10;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.warning-overlay.visible {
  display: flex;
}

.warning-box {
  background: var(--card);
  border-radius: 12px;
  padding: 2rem 1.6rem;
  max-width: 420px;
  text-align: center;
}

.warning-box h3 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.warning-box p {
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.warning-box .primary-button {
  margin-bottom: 0.6rem;
}

/* ---------- 結果画面 ---------- */
.result-hero {
  text-align: center;
  background: var(--card);
  border-top: 6px solid var(--type-color);
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 12px rgba(58, 54, 51, 0.06);
}

.result-judgment {
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 1.4rem;
}

.result-code {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--type-color);
  margin-bottom: 0.2rem;
}

.result-type-name {
  font-size: 2.2rem;
  color: var(--type-color);
  margin-bottom: 0.4rem;
}

.result-color-name {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--ink-light);
  letter-spacing: 0.1em;
  margin-bottom: 1.2rem;
}

.result-catchphrase {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.result-axis-label {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.8rem;
  padding: 0.25rem 0.9rem;
  border: 1px solid var(--type-color);
  border-radius: 999px;
  color: var(--type-color);
}

.result-section {
  background: var(--card);
  border-radius: 12px;
  padding: 1.8rem 1.5rem;
  margin-bottom: 1.5rem;
}

.result-section h3 {
  font-size: 1.05rem;
  padding-left: 0.8rem;
  border-left: 4px solid var(--type-color);
  margin-bottom: 1.2rem;
}

.result-section p {
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

.framing-lead {
  font-weight: 600;
  color: var(--type-color);
  margin-top: 1.2rem;
}

/* 軸スコア表示 */
.axis-row {
  margin-bottom: 1.4rem;
}

.axis-name {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.axis-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.axis-end {
  font-size: 0.75rem;
  color: var(--ink-light);
  white-space: nowrap;
}

.axis-bar {
  position: relative;
  flex: 1;
  height: 10px;
  background: var(--line);
  border-radius: 5px;
}

.axis-center-line {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 1px;
  height: 16px;
  background: var(--ink-light);
}

.axis-marker {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  background: var(--type-color);
  border: 2.5px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  z-index: 1;
}

/* サブ指標「2つのものさし」 */
.sub-note {
  font-size: 0.85rem;
  color: var(--ink-light);
  margin-bottom: 1.4rem;
}

.sub-indicator {
  margin-bottom: 1.6rem;
}

.sub-indicator:last-child {
  margin-bottom: 0;
}

.sub-comment {
  font-size: 0.9rem;
  background: var(--bg);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-top: 0.2rem;
}

.sub-comment strong {
  color: var(--type-color);
}

/* 罠リスト */
.trap-list {
  padding-left: 1.4rem;
}

.trap-list li {
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}

/* 相性カード */
.compat-card {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.2rem;
  margin-bottom: 0.9rem;
}

.compat-tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.75rem;
  padding: 0.15rem 0.7rem;
  border-radius: 4px;
  color: #fff;
  margin-right: 0.6rem;
}

.compat-good .compat-tag { background: var(--r4); }
.compat-hard .compat-tag { background: var(--ink-light); }

.compat-card p {
  font-size: 0.9rem;
  margin: 0.5rem 0 0;
}

.compat-note {
  font-size: 0.85rem;
  color: var(--ink-light);
}

/* 最初の一歩 */
.first-step {
  font-weight: 600;
  background: var(--bg);
  border-left: 4px solid var(--type-color);
  padding: 1rem 1.2rem;
  border-radius: 0 8px 8px 0;
}

/* CTA */
.result-cta {
  text-align: center;
  background: var(--card);
  border: 2px solid var(--type-color);
  border-radius: 12px;
  padding: 2.2rem 1.5rem;
  margin-bottom: 1.5rem;
}

.result-cta h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.result-cta p {
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
}

.cta-teaser-label {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--type-color);
  margin-bottom: 0.6rem !important;
}

.cta-teaser-list {
  list-style: none;
  text-align: left;
  max-width: 340px;
  margin: 0 auto 1.4rem;
  padding: 1rem 1.2rem;
  background: var(--bg);
  border-radius: 10px;
}

.cta-teaser-list li {
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.5rem 0 0.5rem 1.6rem;
  position: relative;
  border-bottom: 1px dashed var(--line);
}

.cta-teaser-list li:last-child {
  border-bottom: none;
}

.cta-teaser-list li::before {
  content: "■";
  position: absolute;
  left: 0;
  color: var(--type-color);
  font-size: 0.8rem;
}

.cta-teaser-outro {
  font-size: 0.9rem;
  margin-bottom: 1.4rem;
}

.cta-button {
  display: inline-block;
  width: 100%;
  max-width: 360px;
  padding: 1.05rem 1.5rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  background: #06c755; /* LINEブランドカラー */
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.2s;
}

.cta-button:hover {
  opacity: 0.85;
}

.cta-closing {
  margin-top: 1.2rem;
  font-size: 0.9rem;
  color: var(--type-color);
}

.result-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.share-main-button {
  width: 100%;
  max-width: 360px;
  padding: 1.05rem 1.5rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  background: var(--type-color);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s;
  box-shadow: 0 2px 10px rgba(58, 54, 51, 0.12);
}

.share-main-button:hover {
  opacity: 0.88;
}

/* ---------- シェアモーダル ---------- */
.share-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58, 54, 51, 0.55);
  z-index: 20;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.share-overlay.visible {
  display: flex;
}

.share-box {
  background: var(--card);
  border-radius: 12px;
  padding: 1.8rem 1.5rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.share-box h3 {
  font-size: 1.05rem;
  margin-bottom: 1.2rem;
}

.share-section-label {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-light);
  text-align: left;
  margin-bottom: 0.6rem;
}

.share-section-note {
  font-size: 0.78rem;
  color: var(--ink-light);
  text-align: left;
  margin-bottom: 0.6rem;
  line-height: 1.6;
}

.share-capture-note {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.8rem;
  text-align: left;
  line-height: 1.65;
}

.share-grid {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.share-grid-text {
  grid-template-columns: repeat(3, 1fr);
}

.share-grid-capture {
  grid-template-columns: repeat(3, 1fr);
}

.share-btn {
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.75rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: opacity 0.2s, border-color 0.2s;
}

.share-btn:hover:not(:disabled) {
  opacity: 0.85;
  border-color: var(--ink-light);
}

.share-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.share-btn-x { color: #000; }
.share-btn-threads { color: #000; }
.share-btn-facebook { color: #1877f2; }
.share-btn-line { color: #06c755; }
.share-btn-instagram {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  color: #fff;
  border: none;
}
.share-btn-tiktok {
  background: #000;
  color: #fff;
  border: none;
}

.share-close {
  margin-top: 0.4rem;
}

.share-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(calc(100% + 3rem));
  background: rgba(58, 54, 51, 0.92);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 0.85rem 1.2rem;
  border-radius: 8px;
  max-width: calc(100% - 2rem);
  text-align: center;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.share-toast.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 480px) {
  .intro-hero h1 {
    font-size: 1.3rem;
  }

  .result-type-name {
    font-size: 1.8rem;
  }

  .axis-end {
    font-size: 0.68rem;
  }

  .share-grid-text,
  .share-grid-capture {
    grid-template-columns: 1fr;
  }

  .share-btn {
    font-size: 0.95rem;
    padding: 0.85rem;
  }
}
