.quest {
  max-width: 50rem;
  padding: clamp(1.35rem, 3vw, 2.25rem) clamp(1rem, 4vw, 3.4rem);
  border: 1px solid #f4d79950;
  border-radius: 1.5rem;
  background: radial-gradient(ellipse at 50% 20%, #3247659c, transparent 75%), #101d39bd;
  text-align: center;
}
.quest [hidden] { display: none; }
.quest h2 { margin: 0; font-size: clamp(1.9rem, 4vw, 2.7rem); }
.quest .quest-hint { margin: .55rem 0 0; font-size: 1rem; }
.quest-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--quest-steps, 5), 1fr);
  align-items: start;
  height: 56px;
  max-width: 27rem;
  margin: 1.7rem auto .75rem;
}
.quest-map svg { position: absolute; inset: 0; width: 100%; height: 100%; color: #d5c6a3; pointer-events: none; }
.quest-star {
  position: relative;
  justify-self: center;
  margin-top: 12px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #f4d799;
}
.quest-star:nth-of-type(even) { margin-top: 0; }
.quest-star::before {
  content: "";
  display: block;
  width: 1.3rem;
  height: 1.6rem;
  margin: auto;
  background: currentColor;
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
}
.quest-star:hover, .quest-star[aria-current="step"] {
  color: #fffde4;
  background: radial-gradient(circle, #fff3c44d, #b899d222 52%, transparent 71%);
}
.quest-star[aria-current="step"] { box-shadow: inset 0 0 0 1px #f4d79999; }
.quest-star[aria-current="step"]::before { width: 1.55rem; height: 1.95rem; }
.quest-hint-star {
  color: #ffe49e;
  background: radial-gradient(circle, #ffe29e38, transparent 68%);
}
.quest-hint-star::after {
  content: "";
  position: absolute;
  pointer-events: none;
  left: 50%;
  bottom: calc(50% + 1rem);
  width: 16px;
  height: 20px;
  transform: translateX(-50%);
  background: linear-gradient(#fff5d4, #ffd77c);
  clip-path: polygon(40% 0, 60% 0, 60% 65%, 88% 44%, 100% 58%, 50% 100%, 0 58%, 12% 44%, 40% 65%);
}
@media (prefers-reduced-motion: no-preference) {
  .quest-hint-star.quest-hint-visible::before {
    animation: quest-beacon 1.5s ease-in-out 3;
  }
  @keyframes quest-beacon {
    0%, 100% { opacity: 1; transform: scale(1); }
    45% { opacity: .6; transform: scale(.86); }
    75% { opacity: 1; transform: scale(1.17); }
  }
}
.quest-position { margin: 0 0 .35rem; color: #f4d799; font-size: .875rem; }
.quest-story { max-width: 35rem; margin: 1rem auto; padding-inline-start: 1.5rem; text-align: left; }
.quest-story li + li { margin-top: 1rem; }
.quest-story h3 { margin: 0 0 .4rem; color: #fff3c4; font: 400 clamp(1.4rem, 3vw, 1.8rem)/1.18 Georgia, serif; }
.quest-story p { font-size: 1rem; line-height: 1.55; margin: 0; color: #f4f1eb; }
.quest.is-interactive .quest-story { list-style: none; padding: 0; text-align: center; margin: 0 auto; }
.quest.is-interactive .quest-story li { margin: 0; }
.quest-controls { display: flex; justify-content: center; gap: .75rem; margin-top: 1.15rem; }
.quest-controls button {
  min-height: 44px;
  padding: .45rem 1rem;
  border-radius: 2rem;
  border: 1px solid #a69c85;
  background: #172946;
  color: #fff3c4;
  font-size: .9rem;
}
.quest-controls button:hover:enabled { background: #324765; }
.quest-controls button:disabled { display: none; }
.quest-controls [data-quest-next] {
  background: #f2d993;
  border-color: #f2d993;
  color: #14213c;
  font-weight: 700;
  text-shadow: none;
  -webkit-text-stroke: 0;
}
.quest-controls [data-quest-next]:hover:enabled { background: #ffe9ac; }

.quest-flight {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.quest-flight > * { position: absolute; opacity: 0; transform: translate(-50%, -50%); }
.quest-comet {
  width: 22px;
  height: 22px;
  background: radial-gradient(circle, #fffde9 0 8%, #ffdf8b94 22%, transparent 68%);
  filter: drop-shadow(0 0 4px #ffe3a8);
}
.quest-comet::before {
  content: "";
  position: absolute;
  inset: 2px;
  background: #fff9db;
  clip-path: polygon(50% 0, 58% 40%, 100% 50%, 58% 59%, 50% 100%, 41% 59%, 0 50%, 41% 40%);
}
.quest-flight i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffe7a0;
  box-shadow: 0 0 4px #f4bf5d;
}
.quest-flight i:nth-of-type(even) { width: 2px; height: 2px; background: #fff6dc; }
.quest-finale .quest-star:not([aria-current]):not(:hover):not(:focus-visible) { color: #a8997f; }
.quest-finale .quest-star[aria-current] {
  background: radial-gradient(circle, #ffedb47a, #c9a37035 53%, transparent 72%);
  color: #fffadb;
}
@media (prefers-reduced-motion: reduce) { .quest-flight { display: none; } }
