.quiz{padding-bottom:54px}
.quiz-sticky{
  height:62px;
  position:sticky;
  top:0;
  z-index:30;
  display:grid;
  grid-template-columns:44px 1fr auto;
  align-items:center;
  background:rgba(246,241,232,.94);
  backdrop-filter:blur(12px);
  border-bottom:1px solid rgba(53,39,61,.05);
}
.top-back{
  width:44px;height:44px;
  border:0;
  background:transparent;
  padding:0;
  color:var(--ink);
  font-size:20px;
  text-align:left;
}
.progress-copy{
  display:flex;
  flex-direction:column;
  text-align:right;
  line-height:1.2;
}
.progress-copy>span{font-size:12px;font-weight:800}
.progress-copy small{margin-top:3px;color:var(--muted);font-size:10px;font-weight:600}
.progress{
  height:7px;
  margin-top:4px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(53,39,61,.08);
}
.progress i{
  display:block;
  width:0;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,var(--purple),#745F7D);
  transition:width .18s ease;
}

.qbody{
  position:relative;
  max-width:680px;
  margin:0 auto;
  padding-top:44px;
  transition:.2s ease;
}
.qbody:after{
  content:"";
  position:absolute;
  right:-8px;top:20px;
  width:34px;height:12px;
  border-top:3px solid var(--lime);
  border-radius:50%;
  transform:rotate(8deg);
  opacity:.75;
}
.quiz-mascot{
  position:absolute;
  right:4px;top:-42px;
  width:54px;height:54px;
  object-fit:contain;
  filter:drop-shadow(0 6px 8px rgba(53,39,61,.09));
  animation:mascotPeek 3.5s ease-in-out infinite;
}
@keyframes mascotPeek{50%{transform:translateY(-4px) rotate(2deg)}}

.hint{
  color:var(--muted);
  font-size:11px;
  font-weight:700;
}
.qbody h2{
  margin:10px 0 26px;
  font-family:var(--font-display);
  font-size:clamp(27px,7.2vw,39px);
  line-height:1.4;
  letter-spacing:-.035em;
  font-weight:900;
}
.answers{display:grid;gap:10px}
.answer{
  width:100%;
  min-height:58px;
  display:grid;
  grid-template-columns:34px 1fr;
  align-items:center;
  padding:14px 16px;
  border:1px solid rgba(53,39,61,.09);
  border-radius:17px;
  background:#fffdf9;
  box-shadow:0 5px 16px rgba(53,39,61,.045);
  color:var(--ink);
  font-family:var(--font-body);
  font-size:14px;
  line-height:1.5;
  font-weight:700;
  text-align:left;
  transition:transform .1s ease,border-color .1s ease,background .1s ease;
}
.answer:hover{border-color:rgba(53,39,61,.2);transform:translateY(-1px)}
.answer:active,.answer.sel{background:#fff;border-color:#9C8DA2;transform:translateY(1px)}
.answer-mark{
  width:29px;height:29px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:rgba(53,39,61,.06);
  color:var(--muted);
  font-size:11px;
  font-weight:900;
}
.answer.sel .answer-mark{background:var(--lime);color:var(--ink)}

.scene-intro{
  margin-bottom:20px;
  padding:13px 14px;
  border-radius:18px;
  background:#fff;
  box-shadow:var(--soft-shadow);
}
.scene-intro span{
  display:block;
  color:var(--muted);
  font-size:9px;
  letter-spacing:.18em;
  font-weight:800;
}
.scene-intro b{
  display:block;
  margin-top:3px;
  font-family:var(--font-display);
  font-size:15px;
}
.qbody.scene{
  margin-top:10px;
  margin-inline:0;
  padding:24px 18px 22px;
  border-radius:24px;
  background:rgba(255,255,255,.38);
}
.qbody.scene .answer{background:#fff}

.milestone{
  min-height:18px;
  margin:20px 0 0;
  color:var(--muted);
  font-size:11px;
  font-weight:700;
}
.milestone.show{
  display:inline-block;
  padding:7px 10px;
  border-radius:12px;
  background:var(--lime);
  color:var(--ink);
  box-shadow:0 4px 0 rgba(53,39,61,.07);
}

.reveal{
  position:fixed;
  inset:0;
  z-index:100;
  display:none;
  place-items:center;
  overflow:hidden;
  background:
    radial-gradient(circle at 50% 36%,var(--reveal-soft,#EFE8F1),transparent 24rem),
    var(--paper);
}
.reveal.on{display:grid}
.reveal-core{width:100%;padding:20px;text-align:center}
.reveal-small{
  margin:30px 0 7px;
  font-family:var(--font-display);
  font-size:18px;
  font-weight:900;
}
.scan{min-height:18px;color:var(--muted);font-size:12px;font-weight:600}
.ghost-stage{
  position:relative;
  width:220px;height:220px;
  display:grid;
  place-items:center;
  margin:8px auto 0;
}
.ghost-stage:before{
  content:"";
  position:absolute;
  inset:16px;
  border-radius:52% 48% 60% 40%;
  background:var(--reveal-soft,#EFE8F1);
  opacity:.75;
  animation:blobBreathe 2s ease-in-out infinite;
}
.ghost{
  position:relative;
  z-index:2;
  width:180px;height:180px;
  object-fit:contain;
  filter:blur(16px) grayscale(.35) brightness(.7);
  opacity:.18;
  animation:ghostReveal 1.45s ease forwards;
}
.spark{
  position:absolute;
  z-index:3;
  width:7px;height:7px;
  border-radius:50%;
  background:var(--purple);
  opacity:.12;
  animation:spark 1.25s ease-in-out infinite;
}
.reveal-final{
  display:inline-block;
  margin-top:3px;
  padding:5px 9px;
  border-radius:9px;
  background:var(--lime);
  color:var(--ink);
  font-size:10px;
  letter-spacing:.15em;
  font-weight:900;
  opacity:0;
  animation:finalReveal .35s 1.4s forwards;
}
@keyframes ghostReveal{
  0%{transform:scale(.78);opacity:.08}
  70%{filter:blur(10px) grayscale(.2);opacity:.36}
  100%{transform:scale(1.06);filter:blur(3px) grayscale(0);opacity:.58}
}
@keyframes spark{50%{transform:translateY(-15px) scale(1.4);opacity:.5}}
@keyframes blobBreathe{50%{transform:scale(1.04) rotate(2deg)}}
@keyframes finalReveal{to{opacity:1}}

@media(max-width:430px){
  .qbody{padding-top:38px}
  .qbody.scene{padding-inline:14px}
  .answer{font-size:13px;padding-inline:13px}
}
@media(prefers-reduced-motion:reduce){
  .quiz-mascot,.ghost-stage:before,.ghost,.spark,.reveal-final{animation:none!important}
  .ghost{filter:none;opacity:.55}
  .reveal-final{opacity:1}
}


/* V13 fixed answer position
   問題文の行数が変わっても、選択肢の開始位置を固定する */
.qbody{
  display:grid;
  grid-template-rows:58px 20px 132px auto auto;
  row-gap:0;
  align-content:start;
}
.scene-intro{
  grid-row:1;
  height:52px;
  margin:0;
  align-self:start;
  overflow:hidden;
}
.scene-intro[hidden]{
  display:block!important;
  visibility:hidden;
  pointer-events:none;
}
.hint{
  grid-row:2;
  min-height:20px;
  display:flex;
  align-items:center;
}
.qbody h2{
  grid-row:3;
  height:132px;
  min-height:132px;
  margin:0;
  padding:8px 0 18px;
  display:flex;
  align-items:center;
  overflow:hidden;
}
.answers{
  grid-row:4;
  align-self:start;
}
.milestone{
  grid-row:5;
}
.qbody.scene{
  margin-top:0;
  padding:44px 0 0;
  border-radius:0;
  background:transparent;
}
.qbody.scene .scene-intro{
  padding:10px 13px;
}
@media(max-width:430px){
  .qbody{
    grid-template-rows:56px 20px 154px auto auto;
  }
  .qbody h2{
    height:154px;
    min-height:154px;
    padding:8px 0 18px;
    font-size:clamp(25px,6.8vw,34px);
    line-height:1.38;
  }
  .qbody.scene{
    padding:38px 0 0;
  }
}
@media(max-width:360px){
  .qbody{
    grid-template-rows:54px 20px 166px auto auto;
  }
  .qbody h2{
    height:166px;
    min-height:166px;
    font-size:24px;
  }
}
