/* Shared quiz / result page layout (MBTI & Enneagram) */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden;
}
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: var(--noise-opacity, 0.4);
}
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
.orb1 {
  width: 600px;
  height: 600px;
  background: var(--orb1);
  top: -200px;
  right: -100px;
}
.orb2 {
  width: 400px;
  height: 400px;
  background: var(--orb2);
  bottom: -100px;
  left: -100px;
}
.wrap {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 80px;
}
.logo,
.site-brand {
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--accent2), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text3);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg2);
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.page-back:hover {
  color: var(--text);
  border-color: rgba(124, 106, 247, 0.4);
}
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.4s;
}
.progress-wrap.visible { opacity: 1; }
.progress-bar-bg {
  width: 160px;
  height: 4px;
  background: var(--bg3);
  border-radius: 2px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  transition: width 0.5s ease;
}
.progress-label {
  font-size: 13px;
  color: var(--text2);
  white-space: nowrap;
}
#hero {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 0;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(124, 106, 247, 0.15);
  border: 1px solid rgba(124, 106, 247, 0.3);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 12px;
  color: var(--accent2);
  letter-spacing: 0.1em;
  margin-bottom: 32px;
}
.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: quiz-pulse 2s infinite;
}
@keyframes quiz-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}
.hero-title {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(36px, 7vw, 72px);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 24px;
}
.hero-title em {
  font-style: normal;
  color: var(--accent2);
}
.hero-sub {
  font-size: 18px;
  color: var(--text2);
  line-height: 1.8;
  max-width: 540px;
  margin: 0 auto 48px;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  color: #fff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 500;
  padding: 16px 40px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 40px rgba(124, 106, 247, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 50px rgba(124, 106, 247, 0.45);
}
.hero-meta {
  margin-top: 40px;
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-meta span,
.hero-stat {
  text-align: center;
  font-size: 13px;
  color: var(--text3);
}
.hero-meta strong,
.hero-stat strong {
  display: block;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
#quiz {
  display: none;
  padding: 40px 0 80px;
  min-height: 60vh;
}
.q-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  animation: quiz-fadeUp 0.4s ease;
}
@keyframes quiz-fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.q-num {
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 28px;
}
.q-page {
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.q-block {
  padding-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.q-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.q-block.answered { opacity: 0.92; }
.q-text {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(17px, 2.8vw, 22px);
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 16px;
  color: var(--text);
}
.q-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  gap: 12px;
}
.btn-back {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 12px 24px;
  border-radius: 100px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-back:hover {
  border-color: var(--text2);
  color: var(--text);
}
.btn-next {
  background: linear-gradient(135deg, var(--accent), var(--accent3));
  border: none;
  color: #fff;
  padding: 12px 32px;
  border-radius: 100px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  font-weight: 500;
  opacity: 0.4;
  pointer-events: none;
}
.btn-next.active {
  opacity: 1;
  pointer-events: auto;
}
.btn-next.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 106, 247, 0.4);
}
#result {
  display: none;
  padding: 40px 0 80px;
}
.result-hero {
  text-align: center;
  margin-bottom: 48px;
}
.type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  background: rgba(124, 106, 247, 0.2);
  color: var(--accent2);
  border: 1px solid rgba(124, 106, 247, 0.3);
  margin-bottom: 20px;
}
.result-type-code {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(64px, 14vw, 120px);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent2), var(--teal));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.result-type-name {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(22px, 4vw, 36px);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.result-type-role {
  font-size: 16px;
  color: var(--accent2);
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}
.result-wing {
  font-size: 15px;
  color: var(--teal);
  margin-bottom: 8px;
}
.result-desc {
  font-size: 17px;
  color: var(--text2);
  line-height: 1.85;
  max-width: 640px;
  margin: 0 auto 20px;
}
.section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  font-weight: 600;
  margin: 28px 0 16px;
  color: var(--text);
}
.fear-desire {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.8;
  margin-bottom: 32px;
  max-width: 640px;
}
.fear-desire strong { color: var(--text); }
.type-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}
.type-bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text3);
  margin-bottom: 8px;
}
.type-bar--active .type-bar-head { color: var(--accent2); }
.type-bar-track {
  height: 8px;
  background: var(--bg3);
  border-radius: 4px;
  overflow: hidden;
}
.type-bar-fill {
  height: 100%;
  background: rgba(124, 106, 247, 0.35);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.type-bar--active .type-bar-fill {
  background: linear-gradient(90deg, var(--accent), var(--teal));
}
.btn-download-pdf {
  border-color: var(--accent);
  color: var(--accent2);
  font-weight: 500;
}
.btn-download-pdf:hover:not(:disabled) {
  background: rgba(124, 106, 247, 0.12);
}
.btn-download-pdf:disabled {
  opacity: 0.55;
  cursor: wait;
}
.cta-section {
  text-align: center;
  margin-top: 48px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
.btn-retry {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
  padding: 14px 32px;
  border-radius: 100px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
}
.btn-retry:hover {
  border-color: var(--text);
  color: var(--text);
}
@media (max-width: 600px) {
  .q-card { padding: 28px 20px; }
  .q-page { gap: 28px; }
  header.mbti-header-row .header-sub {
    flex-direction: column;
    align-items: flex-start;
  }
  .progress-bar-bg { width: 120px; }
}
