:root {
  color-scheme: light;
  --bg: #fbfaf7;
  --paper: #ffffff;
  --ink: #2d3037;
  --muted: #6f7480;
  --line: #e8e1dc;
  --rose: #b35f72;
  --rose-dark: #873f50;
  --blue: #506f9c;
  --lavender: #9a8bc6;
  --soft: #f4ecec;
  --shadow: 0 22px 60px rgba(78, 64, 61, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(140deg, rgba(179, 95, 114, 0.08), transparent 36%),
    linear-gradient(320deg, rgba(80, 111, 156, 0.08), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  overflow-x: hidden;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.app {
  width: min(100%, 780px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

.screen {
  display: none;
  width: 100%;
  min-height: min(760px, calc(100vh - 56px));
  padding: clamp(28px, 6vw, 54px);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(232, 225, 220, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.screen * {
  min-width: 0;
  max-width: 100%;
}

.screen.is-active {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.screen-hero {
  gap: 20px;
}

.hero-visual {
  height: 148px;
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(179, 95, 114, 0.18), transparent 42%),
    linear-gradient(275deg, rgba(80, 111, 156, 0.16), transparent 42%),
    #fffdfb;
  position: relative;
  overflow: hidden;
}

.line,
.dot {
  position: absolute;
  display: block;
}

.line {
  height: 2px;
  background: rgba(45, 48, 55, 0.2);
  transform-origin: left center;
}

.line-one {
  width: 54%;
  left: 11%;
  top: 56%;
  transform: rotate(-7deg);
}

.line-two {
  width: 38%;
  right: 9%;
  top: 39%;
  transform: rotate(9deg);
}

.dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--rose);
}

.dot-one {
  left: 10%;
  top: 50%;
}

.dot-two {
  right: 8%;
  top: 32%;
  border-color: var(--blue);
}

.eyebrow,
.axis-label,
.section-label {
  margin: 0;
  color: var(--rose-dark);
  font-size: 0.84rem;
  font-weight: 750;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 620px;
  margin-bottom: 0;
  font-size: clamp(2.35rem, 7vw, 4.75rem);
  line-height: 1.08;
  font-weight: 820;
  max-width: 100%;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.14;
}

.lead {
  max-width: 610px;
  color: var(--muted);
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  line-height: 1.75;
}

.notice {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.primary-button,
.answer-button,
.secondary-button,
.ghost-button {
  min-height: 52px;
  border-radius: 8px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  width: fit-content;
  max-width: 100%;
  padding: 0 24px;
  background: var(--rose-dark);
  color: #fff;
  font-weight: 780;
  box-shadow: 0 12px 28px rgba(135, 63, 80, 0.22);
}

.primary-button:hover,
.answer-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.intro-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0 28px;
  padding: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #55545c;
  line-height: 1.6;
}

.question-screen {
  gap: 22px;
}

.question-top {
  display: grid;
  gap: 12px;
  margin-bottom: auto;
}

.progress-count {
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  height: 8px;
  background: #ede7e2;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--blue));
  border-radius: inherit;
}

.question-text {
  min-height: 190px;
  display: flex;
  align-items: center;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.8rem);
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.answer-button {
  padding: 0 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 780;
  box-shadow: inset 0 0 0 0 rgba(135, 63, 80, 0);
}

.answer-button:first-child {
  background: #fff7f7;
  border-color: rgba(179, 95, 114, 0.36);
}

.answer-button.is-selected {
  background: var(--rose-dark);
  border-color: var(--rose-dark);
  color: #fff;
  box-shadow: 0 12px 28px rgba(135, 63, 80, 0.2);
}

.answer-button.is-selected::after {
  content: " 선택됨";
  font-size: 0.86em;
  font-weight: 650;
  opacity: 0.86;
}

.ghost-button {
  width: fit-content;
  padding: 0 18px;
  background: transparent;
  color: var(--muted);
  font-weight: 720;
}

.ghost-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.loading-screen {
  align-items: center;
  text-align: center;
  gap: 14px;
}

.loader {
  width: 58px;
  height: 58px;
  border: 4px solid #eee2df;
  border-top-color: var(--rose);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.result-screen {
  padding: clamp(18px, 4vw, 34px);
}

.result-card {
  width: 100%;
  overflow-x: hidden;
}

.result-card * {
  overflow-wrap: anywhere;
  word-break: break-all;
  line-break: anywhere;
}

.result-hero {
  padding: clamp(24px, 5vw, 42px);
  background:
    linear-gradient(135deg, rgba(179, 95, 114, 0.12), transparent 55%),
    #fffdfb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.special-hero {
  background:
    linear-gradient(135deg, rgba(135, 63, 80, 0.18), transparent 52%),
    linear-gradient(315deg, rgba(80, 111, 156, 0.14), transparent 46%),
    #fffafa;
  border-color: rgba(135, 63, 80, 0.32);
}

.special-section {
  background:
    linear-gradient(135deg, rgba(179, 95, 114, 0.1), transparent 55%),
    #fff;
  border-color: rgba(179, 95, 114, 0.28);
}

.result-title {
  margin: 10px 0 18px;
  font-size: clamp(1.85rem, 5vw, 3.7rem);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.angle-title {
  color: var(--rose-dark);
  white-space: normal;
}

.sub-result,
.summary {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.summary {
  margin-bottom: 0;
  color: #4f535d;
  font-weight: 650;
}

.result-section {
  margin-top: 18px;
  padding: clamp(20px, 4vw, 28px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sub-insight {
  background:
    linear-gradient(135deg, rgba(80, 111, 156, 0.08), transparent 56%),
    #fff;
  border-color: rgba(80, 111, 156, 0.22);
}

.result-section h3 {
  margin: 8px 0 14px;
  font-size: 1.25rem;
}

.result-section p,
.result-section li {
  color: #555963;
  line-height: 1.76;
}

.score-list {
  display: grid;
  gap: 14px;
}

.score-row {
  display: grid;
  grid-template-columns: 96px 1fr 82px;
  align-items: center;
  gap: 10px;
}

.score-label {
  font-weight: 750;
}

.score-bar {
  height: 10px;
  background: #eee8e4;
  border-radius: 999px;
  overflow: hidden;
}

.score-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--lavender), var(--blue));
  border-radius: inherit;
}

.score-value {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: right;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
}

.sentence-box {
  margin: 0;
  padding: 18px;
  border-left: 4px solid var(--rose);
  background: #fff8f8;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.7;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.secondary-button {
  padding: 0 18px;
  background: #f3eeea;
  color: var(--ink);
  font-weight: 760;
}

.secondary-button.strong {
  background: var(--rose-dark);
  color: #fff;
}

.footer-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.toast {
  margin-top: 12px;
  color: var(--rose-dark);
  font-weight: 720;
}

@media (max-width: 620px) {
  .app {
    padding: 12px;
    align-items: stretch;
    display: block;
  }

  .screen {
    min-height: calc(100vh - 24px);
    padding: 26px;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
  }

  h1 {
    font-size: clamp(1.85rem, 9vw, 2.35rem);
    line-height: 1.12;
    word-break: break-all;
    line-break: anywhere;
  }

  h2,
  .question-text {
    font-size: clamp(1.75rem, 8vw, 2.45rem);
  }

  .result-title {
    font-size: clamp(1.38rem, 6vw, 1.76rem);
    word-break: break-all;
    line-break: anywhere;
  }

  .result-hero,
  .result-section {
    padding: 20px;
  }

  .sub-result,
  .summary {
    font-size: 0.96rem;
  }

  .result-section h3,
  .result-section p,
  .result-section li {
    word-break: break-all;
    line-break: anywhere;
  }

  .lead {
    font-size: 1rem;
    word-break: break-all;
    line-break: anywhere;
  }

  .hero-visual {
    height: 118px;
  }

  .answer-grid,
  .score-row {
    grid-template-columns: 1fr;
  }

  .question-text {
    min-height: 230px;
  }

  .score-value {
    text-align: left;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }
}
