/* 16タイプ好き費診断 — Figma 53q0kx8et6BspSHQTcDUr8 */

:root {
  --color-bg: #ffffff;
  --color-text: #000000;
  --color-primary: #0081fa;
  --color-primary-border: #3099fb;
  --color-pink: #ea338b;
  --color-pink-soft: #ffd8ef;
  --color-pink-back: #ff0093;
  --color-star: #f8007d;
  --color-progress-empty: #bde2f9;
  --color-placeholder: #c8c8c8;
  --color-debug-muted: #888888;
  --color-debug-border: #989898;
  --color-shell-border: #939393;
  --color-page-bg: #ffffff;
  --color-type-ix: #0bc19a;
  --color-type-ig: #34a6f8;
  --color-type-ex: #f56e3a;
  --color-type-eg: #f75582;

  --radius-pill: 50px;
  --radius-card: 8px;

  --phone-width: 402px;
  --content-pad: 38px;
  --debug-width: 57px;

  --font-line: "LINE Seed JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", sans-serif;
  --font-zen: "Zen Maru Gothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-line);
  color: var(--color-text);
  background: var(--color-page-bg);
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
}

/* —— Shared shell —— */
.app-shell {
  width: 100%;
  max-width: var(--phone-width);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--color-bg);
  border-left: 1px solid var(--color-shell-border);
  border-right: 1px solid var(--color-shell-border);
}

/* 実機スマホではフレーム幅に縛らず画面幅いっぱいへ */
@media (max-width: 767px) {
  body {
    background: var(--color-bg);
  }

  .app-shell {
    max-width: none;
    border-left: none;
    border-right: none;
  }

  .result-body {
    background: #f8007d;
  }
}

.app-main {
  padding: 46px var(--content-pad) 48px;
}

/* —— Buttons —— */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  text-align: center;
  line-height: 1.7;
  word-break: break-word;
  font-family: var(--font-zen);
}

.btn-primary {
  min-height: 77px;
  padding: 10px;
  background: var(--color-primary);
  border-color: var(--color-primary-border);
  color: #ffffff;
  font-weight: 700;
  font-size: 24px;
}

.btn-secondary {
  min-height: 53px;
  padding: 10px;
  background: var(--color-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 500;
  font-size: 18px;
}

.btn-answer {
  min-height: 53px;
  padding: 10px;
  background: var(--color-bg);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.7;
}

.btn-answer.selected {
  background: var(--color-primary);
  border-color: var(--color-primary-border);
  color: #ffffff;
}

.btn-answer:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.btn-answer.selected:disabled {
  opacity: 1;
}

.is-disabled,
button:disabled:not(.btn-answer),
a.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.is-disabled:hover,
.is-disabled:active,
.is-disabled:focus,
button:disabled:not(.btn-answer):hover,
button:disabled:not(.btn-answer):active,
button:disabled:not(.btn-answer):focus,
a.is-disabled:hover,
a.is-disabled:active,
a.is-disabled:focus {
  opacity: 0.5;
  transform: none;
  filter: none;
  box-shadow: none;
}

/* —— Top page —— */
.top-main {
  --content-pad: 38px;
  padding-top: 0;
}

.hero-image {
  width: calc(100% + (var(--content-pad) * 2));
  margin-left: calc(var(--content-pad) * -1);
  margin-right: calc(var(--content-pad) * -1);
  aspect-ratio: 402 / 262;
  overflow: hidden;
  background: transparent;
}

.hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.top-copy {
  margin-top: 23px;
  margin-left: auto;
  margin-right: auto;
  max-width: 326px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.top-lead {
  margin: 0;
  font-family: var(--font-line);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
}

.top-campaign {
  margin: 0;
  font-family: var(--font-line);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.8;
}

.top-campaign .accent {
  color: var(--color-primary);
}

.top-campaign a.accent {
  text-decoration: underline;
  text-underline-position: from-font;
}

.top-campaign .emphasis {
  font-weight: 700;
}

.top-actions {
  margin-top: 19px;
  margin-left: auto;
  margin-right: auto;
  max-width: 324px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

/* —— Diagnosis —— */
.diagnosis-shell {
  position: relative;
  min-height: 100vh;
  padding-bottom: 48px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 65px;
  padding: 20px 10px 10px 22px;
  font-family: var(--font-zen);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
  color: var(--color-text);
  background: transparent;
  border: none;
  cursor: pointer;
}

.back-link__icon {
  display: block;
  width: 7.41px;
  height: 12px;
  margin-right: 8px;
  flex-shrink: 0;
}

.question-hero {
  background: var(--color-pink-soft);
  padding: 18px 24px 20px;
}

.question-hero.has-visual {
  padding: 0;
  background: transparent;
}

.question-visual-wrap {
  display: none;
  width: 100%;
  aspect-ratio: 1200 / 675;
  overflow: hidden;
}

.question-hero.has-visual .question-visual-wrap {
  display: block;
}

.question-visual {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
}

.question-visual[hidden] {
  display: none;
}

.is-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.question-card {
  position: relative;
  background: #ffffff;
  border: 4px solid var(--color-pink);
  border-radius: var(--radius-card);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px 20px;
  text-align: center;
}

.question-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -55%);
  background: var(--color-pink);
  color: #ffffff;
  font-family: var(--font-zen);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.question-text {
  margin: 0;
  color: var(--color-pink);
  font-family: var(--font-zen);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.progress {
  margin-top: 10px;
  display: flex;
  gap: 3px;
  width: 100%;
  padding: 3px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid #ffffff;
  border-radius: 999px;
}

.progress__seg {
  flex: 1 1 0;
  height: 10px;
  border-radius: 3px;
  background: var(--color-progress-empty);
}

.progress__seg.is-done {
  background: var(--color-pink);
}

.diagnosis-layout {
  width: 100%;
  padding: 24px var(--content-pad) 0;
}

.diagnosis-main {
  width: 100%;
}

.answer-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.complete-message {
  margin: 40px 0 0;
  text-align: center;
  font-family: var(--font-zen);
  color: var(--color-text);
}

.complete-message__title {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.7;
}

.complete-message__axes {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.8;
  white-space: pre-line;
}

.complete-message__code {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.7;
}

/* —— Debug panel (temporary overlay) —— */
.debug-panel {
  display: none;
  position: absolute;
  right: 8px;
  bottom: 16px;
  z-index: 10;
  width: var(--debug-width);
  border: 1px solid var(--color-debug-border);
  padding: 5px 4px 8px;
  font-family: var(--font-line);
  background: rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

.debug-panel__title {
  margin: 0 0 6px;
  font-size: 8px;
  font-weight: 400;
  line-height: 1.6;
  white-space: nowrap;
}

.debug-axis {
  margin: 0 0 10px;
}

.debug-axis:last-child {
  margin-bottom: 0;
}

.debug-row {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}

.debug-row--gap {
  margin-top: 2px;
}

.debug-row--sub {
  color: var(--color-debug-muted);
  font-size: 8px;
  line-height: 1.6;
}

.debug-star {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  color: var(--color-star);
  font-size: 6px;
  line-height: 1;
  transform: translateY(-1px);
}

.debug-star.is-empty {
  visibility: hidden;
}

/* —— Narrow phones —— */
@media (max-width: 360px) {
  :root {
    --content-pad: 16px;
    --debug-width: 52px;
  }

  .btn-primary {
    font-size: 20px;
    min-height: 64px;
  }

  .btn-secondary,
  .btn-answer {
    font-size: 16px;
  }

  .question-hero {
    padding: 16px 12px 16px;
  }

  .question-hero.has-visual {
    padding: 0;
  }

  .question-text {
    font-size: 17px;
  }

  .diagnosis-layout {
    padding: 20px var(--content-pad) 0;
  }

  .debug-panel {
    right: 4px;
    padding: 4px 2px 6px;
  }

  .answer-list {
    gap: 12px;
  }
}

@media (max-width: 320px) {
  :root {
    --content-pad: 12px;
    --debug-width: 48px;
  }

  .app-shell {
    border-left: none;
    border-right: none;
  }

  .debug-row {
    font-size: 11px;
  }
}

/* —— Result page —— */
.result-body {
  background: var(--color-page-bg);
}

.result-shell {
  background: #f8007d;
  border-left: none;
  border-right: none;
  padding: 11px 11px 40px;
}

.result-card {
  width: 100%;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 5px;
  /* Figma: 画像は上26 / 左右27。見た目を揃えるため上左右とも27に統一 */
  padding: 27px 27px 40px;
  overflow: hidden;
}

.result-image {
  width: 100%;
  max-width: none;
  margin: 0 0 15px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.result-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition:
    opacity 500ms ease-out,
    transform 500ms ease-out;
}

.result-image img.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .result-image img {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.result-image__placeholder {
  width: 100%;
  height: 100%;
}

.result-header {
  text-align: center;
  margin-bottom: 32px;
}

.result-header__deco {
  display: block;
  width: 42px;
  height: 26px;
  margin: 0 auto 10px;
}

.result-header__deco img {
  display: block;
  width: 42px;
  height: 26px;
}

.result-header__label {
  margin: 0 0 0;
  font-family: var(--font-line);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  color: #f8007d;
}

.result-header__name-wrap {
  max-width: 100%;
  margin: 0 auto 16px;
  text-align: center;
}

/* 旧・単一バー下線。複数行対応のため非表示 */
.result-header__underline {
  display: none;
}

.result-header__name {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  font-family: var(--font-zen);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  color: #f8007d;
  text-align: center;
}

.result-header__name-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.result-header__name-line {
  display: block;
  white-space: nowrap;
  max-width: 100%;
}

.result-header__emoji-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  min-height: 26px;
}

.result-header__emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
}

.result-header__summary {
  margin: 0;
  text-align: left;
  font-family: var(--font-zen);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--color-text);
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-line;
}

.result-section {
  margin-bottom: 32px;
}

.result-section__heading {
  position: relative;
  margin: 0 0 16px;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 18px;
  background: #f8007d;
  color: #ffffff;
  font-family: var(--font-line);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  clip-path: polygon(
    0% 0%,
    100% 0%,
    97.025% 50%,
    100% 100%,
    0% 100%,
    2.975% 50%
  );
}

.result-section__heading-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
}

.result-section__body p,
.result-list,
.result-compatible__desc,
.result-message,
.result-disclaimer {
  font-family: var(--font-line);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--color-text);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-section__body p {
  margin: 0 0 16px;
  white-space: pre-line;
}

.result-section__body p:last-child {
  margin-bottom: 0;
}

.result-list {
  margin: 0;
  padding-left: 1.5em;
}

.result-list li {
  margin-bottom: 8px;
}

.result-list li:last-child {
  margin-bottom: 0;
}

.result-compatible {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.result-compatible__name {
  margin: 0 0 3px;
  font-family: var(--font-line);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-type-eg);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-compatible__name--ix {
  color: var(--color-type-ix);
}

.result-compatible__name--ig {
  color: var(--color-type-ig);
}

.result-compatible__name--ex {
  color: var(--color-type-ex);
}

.result-compatible__name--eg {
  color: var(--color-type-eg);
}

.result-compatible__desc {
  margin: 0;
  white-space: pre-line;
}

.result-message {
  margin: 0;
  font-family: var(--font-zen);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
  white-space: pre-line;
}

.result-message-section {
  margin-bottom: 32px;
}

.result-disclaimer {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: #555555;
  white-space: pre-line;
}

.result-upsell {
  margin: 32px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.result-upsell__title {
  margin: 0;
  font-family: var(--font-line);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.8;
  color: #f8007d;
  text-align: center;
}

.result-upsell__text {
  margin: 0;
  width: 100%;
  font-family: var(--font-line);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--color-text);
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-upsell__link {
  color: var(--color-primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-position: from-font;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.result-actions .btn-secondary {
  gap: 10px;
}

.result-actions__icon {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.btn-share {
  min-height: 77px;
  padding: 10px;
  background: var(--color-primary);
  border: 1px solid var(--color-primary-border);
  color: #ffffff;
  font-weight: 700;
  font-size: 24px;
}

/* —— Type list —— */
.type-list__title {
  margin: 0 0 24px;
  font-family: var(--font-zen);
  font-size: 24px;
  font-weight: 700;
  color: #f8007d;
  text-align: center;
}

.type-list__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.type-list__nav {
  margin: 28px 0 0;
  text-align: center;
  font-family: var(--font-line);
  font-size: 14px;
}

.type-list__nav a {
  color: var(--color-primary);
  text-decoration: underline;
}

@media (max-width: 360px) {
  .result-card {
    padding: 16px 16px 32px;
  }

  .result-header__name {
    font-size: 26px;
  }

  .btn-share {
    font-size: 20px;
    min-height: 64px;
  }
}
