/* ============================================================
   『自由設計ノート』スタイル診断 スタイルシート
   LP (../style.css) とデザイントークンを共有
   ============================================================ */

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
}

img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }
hr { border: 0; margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ---------- Variables (LPと統一) ---------- */
:root {
  --bg: #F5E6D3;
  --bg-alt: #F0DFC6;
  --text: #2C2C2C;
  --text-soft: #5A544E;
  --accent: #F4C2A1;
  --accent-dark: #E8A87C;
  --navy: #2B3A55;
  --divider: rgba(44, 44, 44, 0.12);
  --divider-strong: rgba(44, 44, 44, 0.24);
  --card-bg: rgba(255, 255, 255, 0.45);

  --font-serif: "Noto Serif JP", "Yu Mincho", "游明朝", "YuMincho", "Hiragino Mincho ProN", serif;
  --font-sans: "Noto Sans JP", "Yu Gothic", "游ゴシック", "Hiragino Kaku Gothic ProN", sans-serif;

  --container: 680px;
}

/* ---------- Base ---------- */
body {
  font-family: var(--font-serif);
  font-weight: 400;
  font-feature-settings: "palt" 1;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.9;
  letter-spacing: 0.04em;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

::selection {
  background-color: var(--accent);
  color: var(--text);
}

/* ---------- App shell ---------- */
.app {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.screen {
  width: 100%;
  padding: 72px 24px 88px;
  animation: screenFade 0.55s ease;
}

.screen[hidden] { display: none; }

.screen__inner {
  max-width: var(--container);
  margin: 0 auto;
  text-align: center;
}

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

/* ---------- Shared atoms ---------- */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--text-soft);
  margin-bottom: 20px;
}

.ornament {
  display: block;
  width: 40px;
  height: 2px;
  background-color: var(--accent);
  margin: 0 auto 28px;
}

.divider {
  border-top: 1px solid var(--divider);
  margin: 40px 0;
}

/* ---------- CTA Button (LPと一致) ---------- */
.cta-wrap {
  text-align: center;
  margin-top: 36px;
}

.cta {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: clamp(14px, 2.2vw, 16px);
  font-weight: 700;
  text-decoration: none;
  color: #FFFFFF;
  background-color: var(--accent);
  padding: 20px 40px;
  border-radius: 8px;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 24px rgba(244, 194, 161, 0.45),
              0 2px 6px rgba(44, 44, 44, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  max-width: 100%;
  text-align: center;
  line-height: 1.5;
  cursor: pointer;
}

.cta:hover,
.cta:focus {
  background-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(232, 168, 124, 0.5),
              0 4px 10px rgba(44, 44, 44, 0.1);
}

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

.cta--large {
  padding: 24px 48px;
  font-size: clamp(15px, 2.4vw, 17px);
}

.cta--two-line { padding: 18px 32px; }

.cta__label { display: inline-block; }

.cta__label__sub {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 6px;
  line-height: 1.5;
  word-break: normal;
}

.cta__label__main {
  display: block;
  font-size: inherit;
  line-height: 1.4;
  word-break: normal;
}

.cta__note {
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--text-soft);
  margin-top: 16px;
  letter-spacing: 0.06em;
  line-height: 1.7;
}

/* ============================================================
   【1】スタート画面
   ============================================================ */
.screen--start .screen__inner {
  padding-top: 24px;
}

.start__title {
  font-size: clamp(26px, 5.5vw, 40px);
  font-weight: 700;
  line-height: 1.6;
  letter-spacing: 0.06em;
  color: var(--text);
  margin-bottom: 28px;
}

.start__lead {
  font-size: 15.5px;
  line-height: 2;
  color: var(--text-soft);
  margin-bottom: 44px;
}

.start__meta {
  display: inline-block;
  margin: 0 auto 44px;
  padding: 14px 28px;
  background-color: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-soft);
  letter-spacing: 0.1em;
  line-height: 1.6;
  white-space: nowrap;
}

.start__meta__item {
  display: inline-block;
}

.start__meta__sep {
  display: inline-block;
  margin: 0 12px;
  color: var(--divider-strong);
}

.start__meta strong {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  padding: 0 2px;
}

/* ============================================================
   【2】質問画面
   ============================================================ */
.screen--quiz .screen__inner {
  padding-top: 16px;
}

.progress {
  margin-bottom: 56px;
}

.progress__label {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  margin-bottom: 14px;
}

.progress__current {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.06em;
}

.progress__sep {
  display: inline-block;
  margin: 0 8px;
  color: var(--divider-strong);
}

.progress__total {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-soft);
}

.progress__bar {
  position: relative;
  height: 2px;
  background-color: var(--divider);
  max-width: 320px;
  margin: 0 auto;
  border-radius: 2px;
  overflow: hidden;
}

.progress__fill {
  display: block;
  height: 100%;
  width: 10%;
  background-color: var(--accent-dark);
  transition: width 0.45s cubic-bezier(.5,.1,.25,1);
}

.quiz__question {
  font-size: clamp(19px, 3.6vw, 24px);
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: 0.05em;
  color: var(--text);
  margin: 0 auto 48px;
  max-width: 560px;
  min-height: 3em;
  animation: qFade 0.5s ease;
}

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

.quiz__choices {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 520px;
  margin: 0 auto;
}

.choice {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  padding: 24px 26px;
  background-color: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--divider);
  border-radius: 6px;
  text-align: left;
  font-family: var(--font-serif);
  color: var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease,
              background-color 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 2px 6px rgba(44, 44, 44, 0.04);
  animation: qFade 0.5s ease;
}

.choice:hover,
.choice:focus-visible {
  background-color: rgba(255, 255, 255, 0.8);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(232, 168, 124, 0.2),
              0 2px 6px rgba(44, 44, 44, 0.06);
  outline: none;
}

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

.choice--selected {
  background-color: var(--accent);
  border-color: var(--accent-dark);
  color: #FFFFFF;
}

.choice--selected .choice__letter {
  background-color: #FFFFFF;
  color: var(--accent-dark);
  border-color: #FFFFFF;
}

.choice__letter {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--accent-dark);
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-dark);
  letter-spacing: 0;
  transition: all 0.2s ease;
}

.choice__text {
  flex: 1;
  font-size: 15.5px;
  line-height: 1.75;
}

/* ============================================================
   【3】結果画面
   ============================================================ */
.screen--result .screen__inner {
  padding-top: 16px;
}

.result__icon {
  width: 160px;
  height: 160px;
  margin: 0 auto 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--card-bg);
  border: 1px solid var(--divider);
  border-radius: 50%;
  padding: 16px;
}

.result__icon svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.result__typeno {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--accent-dark);
  margin-bottom: 14px;
}

.result__name {
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 18px;
}

.result__catch {
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--text-soft);
  margin-bottom: 8px;
  font-feature-settings: "palt" 1;
}

.result__block {
  text-align: left;
  max-width: 560px;
  margin: 0 auto 32px;
}

.result__block:last-child { margin-bottom: 0; }

.result__heading {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent-dark);
  margin-bottom: 14px;
  text-align: center;
}

.result__heading::before,
.result__heading::after {
  content: "";
  display: inline-block;
  width: 18px;
  height: 1px;
  background-color: var(--accent);
  vertical-align: middle;
  margin: 0 10px;
}

.result__body {
  font-size: 15.5px;
  line-height: 2;
  color: var(--text);
}

.gift__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.gift__list li {
  position: relative;
  padding: 10px 0 10px 24px;
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text);
  border-bottom: 1px dashed rgba(232, 168, 124, 0.35);
}

.gift__list li:last-child { border-bottom: none; }

.gift__list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 10px;
  color: var(--accent-dark);
  font-size: 13px;
}

.gift__list strong {
  color: var(--accent-dark);
  font-weight: 600;
}

.result__cta {
  margin-top: 8px;
}

.result__guide {
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 auto 4px;
  text-align: left;
  font-feature-settings: "palt" 1;
}

/* ---------- Share ---------- */
.result__share {
  margin-top: 8px;
}

.share__heading {
  font-family: var(--font-sans);
  font-size: 12.5px;
  letter-spacing: 0.2em;
  color: var(--text-soft);
  margin-bottom: 18px;
}

.share__buttons {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  background-color: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--divider);
  border-radius: 999px;
  color: var(--text);
  transition: all 0.22s ease;
  min-width: 108px;
  justify-content: center;
}

.share:hover,
.share:focus-visible {
  background-color: #FFFFFF;
  border-color: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(44, 44, 44, 0.08);
  outline: none;
}

.share svg { flex-shrink: 0; }

.share--x svg { color: #111; }
.share--line svg { color: #06C755; }
.share--ig svg { color: #E1306C; }

.share__ig {
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  margin-top: 8px;
}

/* ---------- Retry ---------- */
.result__retry {
  margin-top: 48px;
}

.retry {
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  padding: 12px 28px;
  border: 1px solid var(--divider-strong);
  border-radius: 999px;
  background-color: transparent;
  transition: all 0.2s ease;
}

.retry:hover,
.retry:focus-visible {
  color: var(--text);
  border-color: var(--text);
  outline: none;
}

.result__home {
  margin-top: 24px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-soft);
  letter-spacing: 0.06em;
}

.result__home a {
  border-bottom: 1px solid var(--divider);
  padding-bottom: 2px;
  transition: border-color 0.2s ease;
}

.result__home a:hover { border-bottom-color: var(--text); }

/* ============================================================
   SVG icon base colors
   (アニメーションは SVG 内 SMIL で定義)
   ============================================================ */
.result__icon svg .stroke {
  fill: none;
  stroke: var(--text);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result__icon svg .stroke-accent {
  fill: none;
  stroke: var(--accent-dark);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result__icon svg .fill-accent { fill: var(--accent-dark); }
.result__icon svg .fill-soft   { fill: var(--accent); }
.result__icon svg .fill-text   { fill: var(--text); }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .screen { padding: 48px 20px 72px; }

  .start__title { letter-spacing: 0.04em; }

  .start__lead { font-size: 14.5px; margin-bottom: 36px; }

  .start__meta {
    padding: 12px 20px;
    margin-bottom: 36px;
    font-size: 12px;
  }

  .start__meta strong { font-size: 15.5px; }
  .start__meta__sep { margin: 0 8px; }

  .progress { margin-bottom: 40px; }

  .quiz__question {
    font-size: 18px;
    margin-bottom: 36px;
    line-height: 1.85;
  }

  .quiz__choices { gap: 16px; }

  .choice { padding: 20px 20px; gap: 16px; }

  .choice__letter { width: 32px; height: 32px; font-size: 13px; }

  .choice__text { font-size: 14.5px; }

  .result__icon { width: 140px; height: 140px; margin-bottom: 26px; }

  .result__body { font-size: 14.5px; }

  .result__guide { font-size: 13.5px; }

  .share { min-width: 96px; padding: 11px 16px; font-size: 12.5px; }

  .cta { display: block; width: 100%; padding: 20px 20px; font-size: 14.5px; letter-spacing: 0.04em; }
  .cta--large { padding: 22px 16px; font-size: 14.5px; }
  .cta--two-line { padding: 16px 14px; }
  .cta__label__sub { font-size: 10.5px; margin-bottom: 5px; }
  .cta__label__main { font-size: 14px; }
}

@media (max-width: 380px) {
  .start__title { font-size: 22px; }

  .start__meta {
    white-space: normal;
    padding: 12px 16px;
  }
  .start__meta__sep { margin: 0 6px; }

  .quiz__question { font-size: 16.5px; }

  .result__name { font-size: 21px; }

  .share__buttons { gap: 10px; }
  .share { min-width: auto; padding: 10px 14px; }
}

/* ============================================================
   Accessibility
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  .result__icon svg * {
    animation: none !important;
    transition: none !important;
  }
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent-dark);
  outline-offset: 4px;
  border-radius: 4px;
}
