﻿:root {
  color-scheme: light;
  --bg: #fbf3ec;
  --bg-soft: #fffaf6;
  --surface: rgba(255, 252, 248, 0.96);
  --surface-strong: #ffffff;
  --text: #21183f;
  --muted: #6f6482;
  --line: #dfcfe6;
  --navy: #11113d;
  --purple: #3b176d;
  --purple-mid: #6b4596;
  --purple-soft: #f3e9fb;
  --pink: #f7dce8;
  --danger: #b3261e;
  --shadow: 0 22px 58px rgba(44, 23, 75, 0.14);
  --font-rounded: "Zen Maru Gothic", "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", "Yu Gothic UI", "Meiryo", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: var(--font-rounded);
  color: var(--text);
  background:
    radial-gradient(circle at 14% 12%, rgba(247, 220, 232, 0.82), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(226, 208, 240, 0.76), transparent 26%),
    linear-gradient(180deg, #fff8f0 0%, #fbf0ed 48%, #f8edf7 100%);
}

body.modal-open {
  overflow: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-repeat: no-repeat;
}

body::before {
  opacity: 0.78;
  background-image:
    radial-gradient(circle, rgba(107, 69, 150, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(107, 69, 150, 0.28) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle, rgba(107, 69, 150, 0.22) 0 1px, transparent 2px);
  background-position: 8% 18%, 88% 14%, 76% 62%, 18% 78%;
  background-size: 160px 160px, 190px 190px, 150px 150px, 210px 210px;
  animation: sparkleDrift 12s ease-in-out infinite alternate;
}

body::after {
  opacity: 0.62;
  background-image:
    url("data:image/svg+xml,%3Csvg width='72' height='72' viewBox='0 0 72 72' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%236b4596' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M36 8 C39 27 45 33 64 36 C45 39 39 45 36 64 C33 45 27 39 8 36 C27 33 33 27 36 8Z' stroke-width='1.8'/%3E%3Cpath d='M57 4 C58 12 60 14 68 15 C60 16 58 18 57 26 C56 18 54 16 46 15 C54 14 56 12 57 4Z' stroke-width='1.4'/%3E%3Cpath d='M13 50 C14 58 16 60 24 61 C16 62 14 64 13 72 C12 64 10 62 2 61 C10 60 12 58 13 50Z' stroke-width='1.2'/%3E%3C/g%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg width='44' height='44' viewBox='0 0 44 44' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M22 5 C24 17 27 20 39 22 C27 24 24 27 22 39 C20 27 17 24 5 22 C17 20 20 17 22 5Z' fill='none' stroke='%236b4596' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: 7% 9%, 91% 18%;
  background-size: 72px 72px, 44px 44px;
  animation: sparkleTwinkle 3.8s ease-in-out infinite;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.diagnosis-card {
  width: min(100%, 760px);
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(223, 207, 230, 0.96);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 40px);
}

.diagnosis-card::before,
.diagnosis-card::after {
  content: "✧";
  position: absolute;
  color: rgba(100, 67, 151, 0.22);
  font-size: 5rem;
  line-height: 1;
  pointer-events: none;
  animation: cardSparkle 4.8s ease-in-out infinite;
}

.diagnosis-card::before {
  top: 28px;
  left: 24px;
}

.diagnosis-card::after {
  right: 22px;
  bottom: 24px;
  transform: rotate(18deg);
  animation-delay: 1.4s;
}

.progress-area {
  position: relative;
  z-index: 1;
  margin-bottom: 28px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee1ef;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--navy), var(--purple-mid));
  transition: width 220ms ease;
}

.screen {
  position: relative;
  z-index: 1;
  min-height: 260px;
  display: grid;
  align-items: center;
}

.start-view,
.question-view,
.completion-view,
.result-view {
  display: grid;
  gap: 26px;
}

.start-view {
  position: relative;
  justify-items: center;
  text-align: center;
  padding: clamp(8px, 2vw, 16px) 0 4px;
}

.start-decoration {
  position: absolute;
  color: var(--purple-mid);
  opacity: 0.58;
  font-size: clamp(1.5rem, 5vw, 2.4rem);
  pointer-events: none;
  animation: floatSparkle 4.2s ease-in-out infinite;
}

.start-decoration-left {
  top: 76px;
  left: clamp(0px, 5vw, 42px);
}

.start-decoration-right {
  top: 108px;
  right: clamp(4px, 6vw, 54px);
  animation-delay: 1.1s;
}

.start-pill,
.section-pill {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 22px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--navy), var(--purple));
  box-shadow: 0 12px 24px rgba(30, 18, 65, 0.18);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0;
}

.start-pill span {
  margin-left: 8px;
  color: #f6b9d6;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 600;
}

.start-hero {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.start-hero h1 {
  margin: 0;
  display: grid;
  gap: 8px;
  color: var(--purple);
  font-family: var(--font-rounded);
  font-size: clamp(1.18rem, 3.35vw, 1.88rem);
  font-weight: 700;
  line-height: 1.72;
  letter-spacing: 0.16em;
}

.start-hero h1 span:first-child {
  font-size: 0.86em;
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.24em;
}

.start-hero h1 span:last-child {
  white-space: nowrap;
}

.wave-line {
  display: none;
}

.start-message {
  display: grid;
  justify-items: center;
  gap: 18px;
}

@keyframes sparkleDrift {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0.55;
  }

  50% {
    opacity: 0.9;
  }

  100% {
    transform: translate3d(12px, -14px, 0);
    opacity: 0.68;
  }
}

@keyframes sparkleTwinkle {
  0%,
  100% {
    opacity: 0.24;
    transform: scale(0.96) rotate(0deg);
  }

  45% {
    opacity: 0.62;
    transform: scale(1.04) rotate(4deg);
  }
}

@keyframes cardSparkle {
  0%,
  100% {
    opacity: 0.16;
    filter: drop-shadow(0 0 0 rgba(107, 69, 150, 0));
  }

  50% {
    opacity: 0.36;
    filter: drop-shadow(0 0 10px rgba(107, 69, 150, 0.24));
  }
}

@keyframes floatSparkle {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.45;
  }

  50% {
    transform: translateY(-8px) scale(1.08);
    opacity: 0.86;
  }
}

.start-message p,
.start-note,
.point-item p,
.recommend-card li,
.result-description {
  overflow-wrap: anywhere;
}

.start-message p {
  max-width: 35rem;
  margin: 0;
  color: var(--text);
  font-size: clamp(1rem, 2.8vw, 1.14rem);
  font-weight: 700;
  line-height: 2;
}

.point-card,
.recommend-card {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.point-card h2 {
  margin: 0;
  padding: 11px 18px;
  color: #ffffff;
  background: linear-gradient(90deg, var(--navy), var(--purple));
  font-size: 1rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.point-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: clamp(18px, 4vw, 28px);
}

.point-item {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 10px;
  padding: 0 14px;
}

.point-item + .point-item {
  border-left: 1px solid rgba(223, 207, 230, 0.78);
}

.point-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  color: var(--purple-mid);
  background: transparent;
}

.point-icon svg {
  width: 72px;
  height: 72px;
  overflow: visible;
}

.icon-ring,
.icon-line {
  fill: none;
  stroke: var(--purple-mid);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-line-small {
  stroke-width: 2.2;
}

.speech-icon {
  width: 72px;
  height: 72px;
}

.speech-icon svg {
  width: 72px;
  height: 72px;
  overflow: visible;
}

.speech-icon path {
  fill: none;
  stroke: var(--purple-mid);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.speech-icon circle {
  fill: var(--purple-mid);
}

.point-item h3 {
  margin: 0;
  color: var(--purple);
  font-size: 1rem;
  line-height: 1.45;
}

.point-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.75;
}

.recommend-card {
  display: grid;
  gap: 10px;
  padding: 22px clamp(20px, 5vw, 34px);
}

.recommend-card h2 {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: var(--purple);
  font-size: 1.1rem;
  line-height: 1.4;
}

.recommend-card h2::before,
.recommend-card h2::after {
  content: "✧";
  color: var(--purple-mid);
  font-size: 1.2rem;
  font-weight: 400;
}

.recommend-card ul {
  width: min(100%, 620px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 32px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  color: var(--text);
  text-align: left;
}

.recommend-card li {
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.55;
}

.primary-button,
.secondary-button,
.share-button,
.answer-button {
  min-height: 58px;
  border-radius: 999px;
  border: 0;
  padding: 16px 24px;
  font-weight: 900;
  line-height: 1.45;
  text-align: center;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.primary-button,
.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(90deg, var(--navy), var(--purple), var(--purple-mid));
  box-shadow: 0 16px 28px rgba(50, 23, 89, 0.24);
}

.start-button {
  width: min(100%, 430px);
  font-size: 1.08rem;
}

.primary-button:hover,
.primary-button:focus-visible,
.share-button:hover,
.share-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 20px 34px rgba(50, 23, 89, 0.3);
}

.start-note {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.7;
}

.question-view {
  justify-items: center;
  text-align: center;
}

.question-label {
  margin: 0;
  color: var(--purple-mid);
  font-size: 0.88rem;
  font-weight: 900;
  text-transform: uppercase;
}

.question-view h2,
.result-view h2 {
  margin: 0;
  color: var(--purple);
  font-size: clamp(1.45rem, 5vw, 2.25rem);
  line-height: 1.38;
}

.answer-list {
  width: 100%;
  display: grid;
  gap: 10px;
}

.answer-button {
  width: 100%;
  border: 2px solid rgba(107, 69, 150, 0.18);
  background: #fffafd;
  color: var(--text);
  text-align: center;
  box-shadow: 0 10px 20px rgba(68, 42, 97, 0.08);
}

.answer-button:hover,
.answer-button:focus-visible {
  border-color: rgba(107, 69, 150, 0.62);
  background: var(--purple-soft);
  transform: translateY(-1px);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(107, 69, 150, 0.32);
  background: #fffafd;
  color: var(--purple);
}

.secondary-button:hover,
.secondary-button:focus-visible {
  border-color: var(--purple-mid);
  background: var(--purple-soft);
  transform: translateY(-1px);
}

.completion-view,
.result-view {
  justify-items: center;
  text-align: center;
}

.completion-view {
  position: relative;
  gap: 28px;
  padding: clamp(6px, 2vw, 14px) 0 4px;
}

.completion-hero {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  width: 100%;
}

.completion-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.15rem, 3vw, 1.7rem);
  font-weight: 800;
  line-height: 1.7;
  letter-spacing: 0.12em;
}

.completion-hero p {
  margin: 0;
  max-width: 35rem;
  color: var(--text);
  font-size: clamp(1rem, 2.6vw, 1.14rem);
  font-weight: 700;
  line-height: 2;
  overflow-wrap: anywhere;
}

.completion-sparkle {
  position: absolute;
  color: var(--purple-mid);
  opacity: 0.68;
  font-size: clamp(1.1rem, 3vw, 1.65rem);
  line-height: 1;
  animation: floatSparkle 4.2s ease-in-out infinite;
}

.completion-sparkle-left {
  top: -18px;
  left: clamp(8px, 3vw, 26px);
}

.completion-sparkle-right {
  top: -18px;
  right: clamp(8px, 3vw, 26px);
  animation-delay: 1.1s;
}

.completion-point-card {
  margin-top: 2px;
}

.completion-message-card {
  width: min(100%, 600px);
  margin: 0;
  padding: 15px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.completion-button {
  width: min(100%, 360px);
  font-size: 1.05rem;
}

.result-image {
  width: min(100%, 480px);
  max-width: 480px;
  height: auto;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: #f8f3ee;
  box-shadow: 0 14px 30px rgba(50, 23, 89, 0.13);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.image-zoom-button {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 480px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
  color: var(--purple-mid);
  cursor: zoom-in;
}

.image-zoom-button:focus-visible {
  outline: 3px solid rgba(107, 69, 150, 0.38);
  outline-offset: 6px;
}

.image-zoom-button:hover .result-image,
.image-zoom-button:focus-visible .result-image {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(50, 23, 89, 0.2);
}

.image-zoom-hint {
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.5;
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.image-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(20, 12, 36, 0.72);
  backdrop-filter: blur(7px);
}

.image-modal-content {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  max-height: min(92vh, 760px);
  display: grid;
  place-items: center;
}

.image-modal-content img {
  max-width: 100%;
  max-height: min(88vh, 720px);
  width: auto;
  height: auto;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: #f8f3ee;
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.34);
}

.image-modal-close {
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #ffffff;
  color: var(--purple);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.result-description {
  margin: 0;
  max-width: 42rem;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.95;
  text-align: left;
}

.result-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.error-message {
  margin: 0;
  color: var(--danger);
  font-weight: 800;
  line-height: 1.8;
  text-align: center;
}

@media (max-width: 640px) {
  .app-shell {
    align-items: start;
    padding: 12px;
  }

  .diagnosis-card {
    border-radius: 24px;
    padding: 22px 16px;
  }

  .diagnosis-card::before,
  .diagnosis-card::after {
    font-size: 3.2rem;
  }

  .screen {
    min-height: 320px;
  }

  .start-view,
  .question-view,
  .completion-view,
  .result-view {
    gap: 22px;
  }

  .start-pill,
  .section-pill {
    min-height: 36px;
    padding: 9px 16px;
    font-size: 0.88rem;
  }

  .start-hero h1 {
    width: 100%;
    max-width: 21rem;
    font-size: clamp(1.08rem, 5.2vw, 1.46rem);
    line-height: 1.65;
    letter-spacing: 0.06em;
  }

  .start-hero h1 span:first-child {
    letter-spacing: 0.16em;
  }

  .start-hero h1 span:last-child {
    white-space: normal;
  }

  .start-message p br {
    display: none;
  }

  .start-message p {
    width: min(100%, 20rem);
    line-height: 1.9;
  }

  .start-decoration {
    font-size: clamp(1.15rem, 6vw, 1.75rem);
    opacity: 0.42;
  }

  .start-decoration-left {
    top: 52px;
    left: 2px;
  }

  .start-decoration-right {
    top: 78px;
    right: 2px;
  }

  .completion-hero h1 {
    letter-spacing: 0.08em;
  }

  .completion-hero p br {
    display: none;
  }

  .completion-sparkle-left {
    top: -16px;
    left: 0;
  }

  .completion-sparkle-right {
    top: -16px;
    right: 0;
  }

  .point-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 22px 18px;
  }

  .point-item {
    padding: 0;
  }

  .point-item + .point-item {
    border-left: 0;
    border-top: 1px solid rgba(223, 207, 230, 0.78);
    padding-top: 18px;
  }

  .recommend-card h2 {
    gap: 12px;
  }

  .recommend-card ul {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button,
  .share-button,
  .answer-button {
    min-height: 60px;
    padding: 15px 18px;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .image-modal {
    padding: 14px;
  }

  .image-modal-close {
    top: -10px;
    right: -8px;
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

