@charset "UTF-8";

/* ===== MAX-W OVERRIDE ===== */
/* .main にスコープし、ヘッダー・フッターに影響させない */
.main {
  --max-w: 720px;
}

/* ===== BODY OVERRIDE ===== */
body {
  min-height: 100vh;
}

/* ===== MAIN CONTAINER ===== */
.main {
  padding-top: var(--header-h);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== INTRO SCREEN ===== */
.screen {
  display: none;
  flex-direction: column;
  min-height: calc(100vh - var(--header-h));
}

.screen--active {
  display: flex;
}

.intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 40px;
  position: relative;
  overflow: hidden;
}

.intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--warm-white), var(--warm-off) 50%, var(--warm-white));
}

.intro::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
}

.intro-content {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.intro-label {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: .25em;
  color: var(--ink-light);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp .8s .2s var(--ease-out) forwards;
}

.intro-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .04em;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp .8s .4s var(--ease-out) forwards;
}

.intro-desc {
  font-size: 14px;
  font-weight: 300;
  line-height: 2.2;
  color: var(--ink-mid);
  margin-bottom: 40px;
  opacity: 0;
  animation: fadeUp .8s .6s var(--ease-out) forwards;
}

.intro-meta {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp .8s .8s var(--ease-out) forwards;
}

.intro-meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.intro-meta-num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--ink);
}

.intro-meta-label {
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: .06em;
}

.intro-start {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--white);
  background: var(--ink);
  padding: 18px 56px;
  border: none;
  transition: all .3s var(--ease);
  opacity: 0;
  animation: fadeUp .8s 1s var(--ease-out) forwards;
}

.intro-start:hover {
  background: var(--black);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
}

.intro-start::after {
  content: '\2192';
  font-family: var(--font-display);
  transition: transform .3s;
}

.intro-start:hover::after {
  transform: translateX(4px);
}

.intro-bg-text {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: clamp(100px, 20vw, 240px);
  font-weight: 400;
  color: rgba(0, 0, 0, .02);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  z-index: 1;
}

/* ===== QUIZ SCREEN ===== */
.quiz {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Progress */
.progress {
  padding: 24px 40px 0;
}

.progress-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-count {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--ink-light);
}

.progress-count span {
  font-size: 20px;
  color: var(--ink);
  font-weight: 500;
}

.progress-pct {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: .06em;
}

.progress-bar {
  height: 3px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width .5s var(--ease-out);
  position: absolute;
  left: 0;
  top: 0;
}

/* Question */
.question-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.question-card {
  max-width: var(--max-w);
  width: 100%;
  opacity: 0;
  transform: translateX(40px);
  transition:
    opacity .5s var(--ease-out),
    transform .5s var(--ease-out);
}

.question-card--active {
  opacity: 1;
  transform: translateX(0);
}

.question-card--exit {
  opacity: 0;
  transform: translateX(-40px);
}

.question-num {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 400;
  color: var(--ink-faint);
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -.02em;
}

.question-category {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 12px;
  text-transform: uppercase;
}

.question-text {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: .04em;
  margin-bottom: 48px;
}

/* Answer options (5-point) */
.answer-scale {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.answer-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.answer-labels span {
  font-size: 11px;
  color: var(--ink-light);
  letter-spacing: .04em;
}

.answer-options {
  display: flex;
  gap: 12px;
}

.answer-btn {
  flex: 1;
  height: 56px;
  border: 1px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-mid);
  transition: all .25s var(--ease);
  position: relative;
  overflow: hidden;
}

.answer-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  opacity: 0;
  transition: opacity .25s;
}

.answer-btn span {
  position: relative;
  z-index: 1;
  transition: color .25s;
}

.answer-btn:hover {
  border-color: var(--ink-faint);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
}

.answer-btn--selected {
  border-color: var(--accent);
  background: var(--accent-pale);
}

.answer-btn--selected::before {
  opacity: .08;
}

.answer-btn .btn-label {
  display: none;
}

/* Nav */
.quiz-nav {
  padding: 24px 40px 40px;
  display: flex;
  justify-content: center;
}

.quiz-nav-inner {
  max-width: var(--max-w);
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--ink-light);
  padding: 12px 0;
  transition: color .3s;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-btn:hover {
  color: var(--ink);
}

.nav-btn--back::before {
  content: '\2190';
  font-family: var(--font-display);
}

.nav-btn--hidden {
  visibility: hidden;
}

/* ===== LOADING SCREEN ===== */
.loading {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 40px;
}

.loading-text {
  font-family: var(--font-serif);
  font-size: 20px;
  color: var(--ink-mid);
  letter-spacing: .04em;
}

.loading-bar {
  width: 200px;
  height: 2px;
  background: var(--border);
  position: relative;
  overflow: hidden;
}

.loading-bar::after {
  content: '';
  position: absolute;
  left: -50%;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--accent);
  animation: loadSlide 1.2s ease-in-out infinite;
}

@keyframes loadSlide {
  0%   { left: -50%; }
  100% { left: 100%; }
}

/* ===== RESULT SCREEN ===== */
.result {
  flex: 1;
  padding: 60px 40px 80px;
}

.result-inner {
  max-width: 860px;
  margin: 0 auto;
}

.result-header {
  text-align: center;
  margin-bottom: 64px;
  opacity: 0;
  animation: fadeUp .8s .2s var(--ease-out) forwards;
}

.result-label {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .25em;
  color: var(--ink-light);
  margin-bottom: 16px;
}

.result-title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: .04em;
  margin-bottom: 12px;
}

.result-subtitle {
  font-size: 14px;
  color: var(--ink-mid);
  font-weight: 300;
}

/* Top result */
.result-top {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 48px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeUp .8s .5s var(--ease-out) forwards;
}

.result-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #6d9b4a);
}

.result-top-rank {
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: .2em;
  color: var(--accent);
  margin-bottom: 8px;
}

.result-top-name {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 500;
  letter-spacing: .04em;
  margin-bottom: 4px;
}

.result-top-name-en {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--ink-light);
  letter-spacing: .1em;
  margin-bottom: 24px;
}

.result-top-score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 24px;
}

.result-top-pct {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 400;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -.02em;
}

.result-top-pct-label {
  font-size: 13px;
  color: var(--ink-light);
}

.result-top-desc {
  font-size: 14px;
  font-weight: 300;
  line-height: 2.2;
  color: var(--ink-mid);
  margin-bottom: 32px;
}

/* Radar chart */
.radar-wrap {
  display: flex;
  justify-content: center;
  margin: 32px 0;
}

.radar-svg {
  width: 280px;
  height: 280px;
}

.radar-grid {
  fill: none;
  stroke: var(--border);
  stroke-width: .5;
}

.radar-axis {
  stroke: var(--border-light);
  stroke-width: .5;
}

.radar-polygon {
  fill: rgba(60, 110, 30, .12);
  stroke: var(--accent);
  stroke-width: 2;
}

.radar-label {
  font-size: 11px;
  fill: var(--ink-mid);
  font-family: var(--font-body);
  letter-spacing: .02em;
}

.radar-dot {
  fill: var(--accent);
  r: 4;
}

/* Tags */
.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.result-tag {
  font-size: 12px;
  letter-spacing: .04em;
  padding: 6px 16px;
  border: 1px solid var(--border);
}

.result-tag--match {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-pale);
}

/* Runner up */
.result-runners {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 64px;
}

.result-runner {
  background: var(--white);
  border: 1px solid var(--border);
  padding: 28px;
  opacity: 0;
  animation: fadeUp .6s var(--ease-out) forwards;
}

.result-runner:nth-child(1) { animation-delay: .7s; }
.result-runner:nth-child(2) { animation-delay: .85s; }

.result-runner-rank {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .15em;
  color: var(--ink-light);
  margin-bottom: 6px;
}

.result-runner-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .04em;
  margin-bottom: 4px;
}

.result-runner-en {
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: .08em;
  margin-bottom: 12px;
}

.result-runner-score {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--accent);
  font-weight: 400;
  margin-bottom: 8px;
}

.result-runner-desc {
  font-size: 12px;
  color: var(--ink-mid);
  line-height: 1.8;
}

/* Result CTA */
.result-cta {
  background: var(--ink);
  color: var(--white);
  padding: 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeUp .8s 1s var(--ease-out) forwards;
}

.result-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

.result-cta-inner {
  position: relative;
  z-index: 2;
}

.result-cta-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: .04em;
  margin-bottom: 12px;
  line-height: 1.7;
}

.result-cta-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, .5);
  line-height: 2;
  margin-bottom: 28px;
}

.result-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--ink);
  background: var(--white);
  padding: 16px 48px;
  border: none;
  transition: all .3s var(--ease);
}

.result-cta-btn:hover {
  background: var(--warm-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.result-cta-btn::after {
  content: '\2192';
  font-family: var(--font-display);
  transition: transform .3s;
}

.result-cta-btn:hover::after {
  transform: translateX(4px);
}

.result-cta-note {
  font-size: 11px;
  color: rgba(255, 255, 255, .25);
  margin-top: 12px;
}

/* Result actions */
.result-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 48px;
  opacity: 0;
  animation: fadeUp .6s 1.1s var(--ease-out) forwards;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-mid);
  letter-spacing: .04em;
  padding: 12px 24px;
  border: 1px solid var(--border);
  background: none;
  transition: all .3s;
  cursor: pointer;
}

.action-btn:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
  background: var(--white);
}

.action-btn svg {
  width: 16px;
  height: 16px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .intro { padding: 40px 20px; }
  .intro-meta { gap: 20px; }
  .progress { padding: 16px 20px 0; }
  .question-area { padding: 32px 20px; }
  .question-num { font-size: 40px; }
  .answer-options { flex-wrap: wrap; gap: 8px; }
  .answer-btn { min-width: calc(20% - 8px); height: 48px; }
  .quiz-nav { padding: 16px 20px 32px; }
  .result { padding: 40px 20px 60px; }
  .result-top { padding: 32px; }
  .result-top-pct { font-size: 40px; }
  .result-runners { grid-template-columns: 1fr; }
  .result-cta { padding: 40px 24px; }
  .result-actions {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 600px) {
  .answer-labels { display: none; }
  .answer-options { flex-direction: column; gap: 10px; }
  .answer-btn {
    height: auto;
    padding: 14px 20px;
    justify-content: flex-start;
    min-width: 100%;
  }
  .answer-btn > span {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
  }
  .answer-btn .btn-num {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 500;
    min-width: 28px;
    color: var(--ink-faint);
    text-align: left;
  }
  .answer-btn .btn-label {
    display: block;
    font-size: 13px;
    color: var(--ink-mid);
    text-align: left;
  }
  .answer-btn--selected .btn-num { color: var(--accent); }
  .answer-btn--selected .btn-label { color: var(--accent); }
}
