:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --ink: #20242c;
  --muted: #6b7280;
  --line: #e1e6ef;
  --card: #ffffff;
  --friend: #48c7a4;
  --friend-dark: #13775d;
  --work: #5f83d8;
  --work-dark: #244f9b;
  --love: #eb8095;
  --love-dark: #b53f56;
  --panel: #20242c;
  --shadow: 0 20px 44px rgba(32, 36, 44, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(72, 199, 164, 0.13), transparent 30%),
    linear-gradient(240deg, rgba(235, 128, 149, 0.14), transparent 34%),
    var(--bg);
  color: var(--ink);
  font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.app {
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px;
}

.screen {
  display: none;
  min-height: calc(100vh - 44px);
}

.screen.is-active {
  display: flex;
}

.intro-screen {
  position: relative;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  overflow: hidden;
}

.intro-visual {
  position: relative;
  width: 100%;
  height: clamp(220px, 50vw, 320px);
  margin: 0 0 4px;
}

.tone {
  position: absolute;
  bottom: 0;
  display: block;
  margin: 0;
}

.tone img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  filter: drop-shadow(0 12px 14px rgba(32, 36, 44, 0.14));
}

.tone-friend {
  left: 2%;
  top: 0;
  bottom: auto;
  z-index: 1;
  width: 37%;
  animation: float-friend 3.8s ease-in-out infinite;
}

.tone-work {
  left: 50%;
  top: 50%;
  bottom: auto;
  z-index: 3;
  width: 39%;
  transform: translate(-50%, -50%);
  animation: float-work 4.4s ease-in-out infinite;
}

.tone-love {
  right: 2%;
  bottom: 0;
  z-index: 2;
  width: 37%;
  transform: none;
  animation: float-love 4s ease-in-out infinite;
}

@keyframes float-friend {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(10px, -22px);
  }
}

@keyframes float-work {
  0%,
  100% {
    transform: translate(-50%, -50%);
  }
  50% {
    transform: translate(calc(-50% - 12px), calc(-50% + 20px));
  }
}

@keyframes float-love {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-10px, -24px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tone {
    animation: none;
  }
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 2px;
  font-size: clamp(2.55rem, 12vw, 4.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.subtitle {
  margin-bottom: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.45;
}

.body-copy,
.hint {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}

.hint {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 52px;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 850;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.primary-button {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 16px 32px rgba(32, 36, 44, 0.18);
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
}

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

.quiz-screen,
.result-screen {
  flex-direction: column;
  gap: 12px;
  padding: 6px 0 20px;
}

.quiz-top,
.question-card,
.result-hero,
.transform-summary,
.result-card,
.analysis-card,
.share-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.quiz-top {
  padding: 12px;
  box-shadow: none;
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 800;
}

.progress-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.scene-pill {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(80, 227, 183, 0.18);
  color: var(--friend);
}

.scene-pill.work {
  background: rgba(143, 183, 255, 0.18);
  color: var(--work);
}

.scene-pill.love {
  background: rgba(255, 140, 159, 0.2);
  color: var(--love);
}

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

.progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--friend), var(--work), var(--love));
  transition: width 0.2s ease;
}

.question-card {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-content: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 14px;
}

.question-card.friend {
  border-color: rgba(72, 199, 164, 0.28);
}

.question-card.work {
  border-color: rgba(95, 131, 216, 0.28);
}

.question-card.love {
  border-color: rgba(235, 128, 149, 0.3);
}

.question-card.friend .question-text {
  border-left-color: var(--friend);
}

.question-card.work .question-text {
  border-left-color: var(--work);
}

.question-card.love .question-text {
  border-left-color: var(--love);
}

.question-text {
  position: relative;
  margin: 0;
  min-height: 0;
  border: 0;
  border-radius: 20px;
  padding: clamp(20px, 6vw, 30px);
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 -8px 0 rgba(23, 25, 29, 0.06);
  font-size: clamp(1.18rem, 5.4vw, 1.9rem);
  font-weight: 850;
  line-height: 1.48;
  white-space: pre-line;
  word-break: keep-all;
}

.choice-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.answer-card {
  position: relative;
  display: grid;
  min-height: 124px;
  gap: 0;
  align-content: center;
  border: 2px solid rgba(72, 199, 164, 0.18);
  border-radius: 18px;
  padding: 16px 13px;
  background: #effaf6;
  color: var(--ink);
  text-align: center;
  box-shadow: none;
}

.answer-b {
  border-color: rgba(235, 128, 149, 0.2);
  background: #fff0f3;
}

.answer-card span {
  color: inherit;
  font-size: clamp(0.98rem, 4.4vw, 1.28rem);
  font-weight: 850;
  line-height: 1.42;
  word-break: keep-all;
}

.answer-card.is-selected {
  box-shadow: 0 18px 36px rgba(32, 36, 44, 0.14);
}

.answer-a.is-selected {
  border-color: #22b98d;
  background: #45d8ad;
  color: #0f3f32;
}

.answer-b.is-selected {
  border-color: #e45f7a;
  background: #ff8fa4;
  color: #5c1626;
}

.result-hero,
.transform-summary,
.analysis-card,
.share-box {
  padding: 20px;
}

.result-hero h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 8vw, 3.3rem);
  line-height: 1.05;
}

.result-hero,
.result-card,
.analysis-card,
.share-box {
  background: #fff;
  color: var(--ink);
}

.result-hero p:last-child,
.transform-summary p:last-child,
.analysis-card p:last-child,
.share-box p:last-child {
  margin-bottom: 0;
}

.transform-summary {
  border-color: var(--line);
  background: var(--ink);
  color: #fff;
}

.transform-summary h3 {
  margin-bottom: 8px;
  font-size: 1.9rem;
}

.transform-summary p {
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.65;
}

.result-grid,
.analysis-grid {
  display: grid;
  gap: 14px;
}

.result-card {
  overflow: hidden;
  border-radius: 18px;
}

.result-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
}

.result-card h3 {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.98rem;
}

.mbti {
  font-size: 3.1rem;
  font-weight: 950;
  line-height: 0.9;
}

.character-frame {
  display: grid;
  width: 118px;
  height: 118px;
  flex: 0 0 auto;
  place-items: end center;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(23, 25, 29, 0.06);
}

.character-frame img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 10px 14px rgba(32, 36, 44, 0.14));
}

.character-frame.friend {
  background: rgba(72, 199, 164, 0.16);
}

.character-frame.work {
  background: rgba(95, 131, 216, 0.15);
}

.character-frame.love {
  background: rgba(235, 128, 149, 0.16);
}

.result-card.friend {
  border-top: 6px solid var(--friend);
}

.result-card.work {
  border-top: 6px solid var(--work);
}

.result-card.love {
  border-top: 6px solid var(--love);
}

.result-content {
  display: grid;
  gap: 14px;
  padding: 0 20px 20px;
}

.interpretation,
.quote,
.analysis-card p,
.share-box p {
  color: var(--muted);
  line-height: 1.7;
}

.quote {
  border-left: 0;
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(23, 25, 29, 0.06);
  font-weight: 850;
}

.analysis-card h3,
.share-box h3 {
  margin-bottom: 8px;
}

.share-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 16px;
}

.share-box .primary-button {
  background: var(--ink);
  color: #fff;
}

.share-box .secondary-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.toast {
  min-height: 24px;
  margin-top: 12px;
  color: var(--friend);
  font-weight: 800;
}

@media (min-width: 700px) {
  .app {
    padding: 34px;
  }

  .intro-visual {
    height: 340px;
  }

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