:root {
  --bg-top: #fff8ec;
  --bg-bottom: #eaf5ff;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-sub: #4b5563;
  --text-muted: #6b7280;

  --primary: #ff6b4a;
  --primary-hover: #f25533;
  --primary-soft: #fff0eb;

  --blue: #3b82f6;
  --blue-soft: #eff6ff;
  --blue-border: #bfdbfe;

  --purple: #8b5cf6;
  --purple-soft: #f5f3ff;
  --purple-border: #ddd6fe;

  --green: #10b981;
  --green-soft: #ecfdf5;

  --amber: #f59e0b;
  --amber-soft: #fffbeb;

  --shadow-card: 0 12px 32px rgba(31, 41, 55, 0.08);
  --shadow-btn: 0 6px 16px rgba(255, 107, 74, 0.28);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  color: var(--text-main);
  background: linear-gradient(160deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
}

.bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(48px);
  opacity: 0.45;
}

.shape-1 {
  width: 280px;
  height: 280px;
  background: #ffd6a5;
  top: -70px;
  left: -60px;
}

.shape-2 {
  width: 320px;
  height: 320px;
  background: #c7e4ff;
  bottom: -90px;
  right: -70px;
}

.shape-3 {
  width: 200px;
  height: 200px;
  background: #e2d4ff;
  top: 42%;
  right: 8%;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.screen {
  display: none;
  animation: fadeSlideUp 0.35s ease;
}

.screen.active {
  display: block;
}

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

.card {
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 28px 22px;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.badge-pill {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* 시작 화면 */
.start-card {
  text-align: center;
}

.hero-emoji {
  font-size: 3.6rem;
  margin: 4px 0 8px;
  animation: floatBounce 2.8s ease-in-out infinite;
}

@keyframes floatBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.app-title {
  font-family: "Jua", "Noto Sans KR", sans-serif;
  font-size: 2.3rem;
  color: #1f2937;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.app-subtitle {
  font-size: 1.06rem;
  color: var(--text-sub);
  margin-bottom: 24px;
}

.app-subtitle strong {
  color: var(--primary);
}

.feature-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  margin-bottom: 26px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f9fafb;
  border-radius: var(--radius-md);
  padding: 13px 16px;
  border: 1.5px solid #f1f5f9;
}

.feature-icon {
  font-size: 1.85rem;
  flex-shrink: 0;
}

.feature-item strong {
  display: block;
  font-size: 0.98rem;
  color: var(--text-main);
  margin-bottom: 2px;
}

.feature-item p {
  font-size: 0.88rem;
  color: var(--text-sub);
}

/* 버튼 공통 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #ff7b54 0%, #ff5733 100%);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #ff6c40 0%, #ea4722 100%);
}

.btn-mixed {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.28);
}

.btn-mixed:hover {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
}

.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-btn {
  flex-direction: column;
  gap: 3px;
  padding: 15px 18px;
}

.mode-btn small {
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.92;
}

.try-other-btn {
  margin-top: 10px;
  padding: 13px 16px;
  font-size: 0.96rem;
}

.btn-secondary {
  background: #f3f4f6;
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid #ffd5c8;
}

.btn-large {
  width: 100%;
  padding: 16px 20px;
  font-size: 1.15rem;
}

.btn-small {
  padding: 7px 14px;
  font-size: 0.88rem;
  border-radius: 12px;
}

.recent-result-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1.5px dashed #e5e7eb;
}

.recent-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.recent-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.recent-badge {
  font-family: "Jua", sans-serif;
  font-size: 1.15rem;
  color: var(--blue);
  background: var(--blue-soft);
  padding: 6px 14px;
  border-radius: 12px;
}

/* 단계 안내 화면 */
.stage-card {
  text-align: center;
  padding: 36px 24px;
}

.stage-emoji {
  font-size: 4rem;
  margin: 8px 0 12px;
}

.stage-title {
  font-family: "Jua", "Noto Sans KR", sans-serif;
  font-size: 1.85rem;
  margin-bottom: 12px;
}

.stage-desc {
  font-size: 1.03rem;
  color: var(--text-sub);
  margin-bottom: 20px;
}

.stage-tip {
  background: var(--amber-soft);
  color: #92400e;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 24px;
}

/* 퀴즈 화면 */
.quiz-header {
  margin-bottom: 16px;
}

.quiz-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.btn-icon {
  background: #fff;
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 7px 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-sub);
  cursor: pointer;
}

.btn-icon:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quiz-stage-pill {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.quiz-counter {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text-main);
  min-width: 58px;
  text-align: right;
}

.progress-track {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffb347 0%, #ff6b4a 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.question-card {
  padding: 24px 20px;
}

.question-card.card-pop {
  animation: cardPop 0.25s ease;
}

@keyframes cardPop {
  from {
    opacity: 0.4;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.subtopic-tag {
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.question-prompt {
  font-family: "Jua", "Noto Sans KR", sans-serif;
  font-size: 1.45rem;
  color: var(--text-main);
  margin-bottom: 18px;
  line-height: 1.38;
}

.choices-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.choice-box {
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.choice-a {
  background: var(--blue-soft);
  border-color: var(--blue-border);
}

.choice-b {
  background: var(--purple-soft);
  border-color: var(--purple-border);
}

.choice-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.choice-emoji {
  font-size: 2.15rem;
  flex-shrink: 0;
}

.choice-text {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.45;
  word-break: keep-all;
}

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

.pick-btn {
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  padding: 12px 10px;
  border-radius: 13px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.14s ease;
}

.pick-btn:active {
  transform: scale(0.96);
}

.pick-strong-a {
  background: #3b82f6;
  color: #ffffff;
}

.pick-strong-a:hover {
  background: #2563eb;
}

.pick-mild-a {
  background: #ffffff;
  color: #2563eb;
  border-color: #93c5fd;
}

.pick-mild-a:hover {
  background: #dbeafe;
}

.pick-strong-b {
  background: #8b5cf6;
  color: #ffffff;
}

.pick-strong-b:hover {
  background: #7c3aed;
}

.pick-mild-b {
  background: #ffffff;
  color: #7c3aed;
  border-color: #c4b5fd;
}

.pick-mild-b:hover {
  background: #ede9fe;
}

.pick-btn.selected {
  box-shadow: 0 0 0 3px #fbbf24;
  transform: scale(1.02);
}

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: -2px 0;
}

.vs-divider::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  height: 1.5px;
  background: #e5e7eb;
}

.vs-divider span {
  position: relative;
  background: #ffffff;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 999px;
  border: 1.5px solid #e5e7eb;
}

/* 결과 화면 */
#screen-result {
  display: none;
}

#screen-result.active {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.result-hero-card {
  text-align: center;
}

.result-emoji {
  font-size: 4.2rem;
  margin: 4px 0;
}

.result-code {
  font-family: "Jua", sans-serif;
  font-size: 3rem;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #ff6b4a 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.result-nickname {
  font-family: "Jua", "Noto Sans KR", sans-serif;
  font-size: 1.55rem;
  color: var(--text-main);
  margin-bottom: 12px;
}

.result-summary {
  font-size: 1.02rem;
  color: var(--text-sub);
  word-break: keep-all;
  margin-bottom: 22px;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result-actions .btn {
  padding: 13px 14px;
  font-size: 0.95rem;
}

.copy-toast {
  margin-top: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--green);
}

/* 결과 섹션 카드 */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-icon {
  font-size: 1.7rem;
}

.section-header h3 {
  font-family: "Jua", "Noto Sans KR", sans-serif;
  font-size: 1.3rem;
  color: var(--text-main);
}

.section-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* E/I 심층 카드 */
.ei-deep-card {
  border: 2px solid #dbeafe;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.ei-subtype-banner {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 18px;
}

.ei-subtype-badge {
  display: inline-block;
  background: #2563eb;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.ei-subtype-title {
  font-size: 1.12rem;
  color: #1e3a8a;
  margin-bottom: 6px;
  word-break: keep-all;
}

.ei-subtype-desc {
  font-size: 0.94rem;
  color: #334155;
  word-break: keep-all;
}

.ei-sub-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 18px;
}

.ei-sub-item {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 14px;
}

.ei-sub-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.ei-sub-tag {
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
}

.ei-sub-tag.is-e {
  background: #ffedd5;
  color: #c2410c;
}

.ei-sub-tag.is-i {
  background: #ede9fe;
  color: #6d28d9;
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.bar-track {
  position: relative;
  height: 14px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.bar-left {
  height: 100%;
  transition: width 0.5s ease;
}

.bar-right {
  height: 100%;
  transition: width 0.5s ease;
}

.ei-note-box {
  background: var(--amber-soft);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.92rem;
  color: #78350f;
  word-break: keep-all;
}

.ei-note-box strong {
  display: block;
  margin-bottom: 4px;
}

/* 4가지 기본 성향 바 */
.dimension-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dim-item {
  background: #f9fafb;
  border-radius: 14px;
  padding: 13px 15px;
}

.dim-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 7px;
}

.dim-winner {
  color: var(--primary);
}

/* 리스트 & 단짝 */
.pretty-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pretty-list li {
  background: #f9fafb;
  border-radius: 13px;
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--text-main);
  word-break: keep-all;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.strengths-list li {
  background: var(--green-soft);
}

.tips-list li {
  background: var(--amber-soft);
}

.divider-line {
  height: 1.5px;
  background: #f1f5f9;
  margin: 22px 0;
}

.matches-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.match-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  text-align: center;
}

.match-emoji {
  font-size: 2rem;
  margin-bottom: 4px;
}

.match-code {
  font-family: "Jua", sans-serif;
  font-size: 1.25rem;
  color: var(--primary);
}

.match-name {
  font-size: 0.85rem;
  color: var(--text-sub);
  word-break: keep-all;
}

.hidden {
  display: none !important;
}

@media (max-width: 460px) {
  .app-container {
    padding: 14px 12px 36px;
  }
  .card {
    padding: 22px 16px;
  }
  .app-title {
    font-size: 2rem;
  }
  .question-prompt {
    font-size: 1.3rem;
  }
  .choice-text {
    font-size: 1rem;
  }
  .pick-btn {
    font-size: 0.88rem;
    padding: 11px 8px;
  }
}
