/* /quiz — the interactive card, and the plain fallback underneath it. */

/* The fallback is the default state: it is in the markup, visible, and readable
   with no JavaScript at all. script.js hides it and un-hides the interactive
   card only once it has successfully parsed the quiz data — so a script that
   fails to load, or throws, leaves a working page rather than a blank one. */
.quiz-fallback .nojs-list {
  padding-left: 1.1rem;
}
.quiz-fallback .nojs-q {
  margin-bottom: 18px;
}
.quiz-fallback .nojs-qt {
  font-weight: 700;
  margin-bottom: 4px !important;
}
.quiz-fallback .nojs-q ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}
.quiz-fallback .nojs-r {
  margin-bottom: 18px;
}
.quiz-fallback .nojs-r h3 {
  font-family: var(--f-display);
  font-size: 1.25rem;
  margin: 0 0 4px;
  color: var(--shock);
}
.quiz-fallback .nojs-r p {
  color: var(--muted);
  font-size: 0.94rem;
}

/* ------------------------------------------------------------- shell ---- */

.quiz {
  margin: 8px 0 0;
}

.quiz-card {
  position: relative;
  padding: 26px 20px 22px;
  background: linear-gradient(168deg, rgba(41, 22, 74, 0.92), rgba(17, 9, 30, 0.96));
  border: 1px solid var(--hairline);
  border-radius: var(--r-card);
  overflow: hidden;
}
.quiz-card::before {
  content: '';
  position: absolute;
  inset: auto -20% -60% -20%;
  height: 80%;
  background: radial-gradient(50% 100% at 50% 100%, rgba(255, 62, 165, 0.24), transparent 72%);
  pointer-events: none;
}

/* A fresh card should feel like it arrived, not like text changed. */
.quiz-card > * {
  position: relative;
}
.quiz-card.enter {
  animation: cardin 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes cardin {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------- progress ---- */

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}
.quiz-step {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cyber);
  flex: none;
}
.quiz-bar {
  flex: 1;
  height: 7px;
  border-radius: var(--r);
  background: rgba(181, 123, 255, 0.22);
  overflow: hidden;
}
.quiz-bar i {
  display: block;
  height: 100%;
  border-radius: var(--r);
  background: linear-gradient(90deg, var(--cyber), var(--bubble));
  box-shadow: 0 0 12px -2px var(--bubble);
  transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------- questions ---- */

.quiz-q {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.22;
  margin: 0 0 18px !important;
}

.quiz-options {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quiz-opt {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 14px 16px 14px 48px;
  position: relative;
  text-align: left;
  font: inherit;
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--milk);
  background: rgba(11, 6, 20, 0.66);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}
/* The marker doubles as the letter and as the selected state, so a chosen
   answer is legible without relying on colour alone. */
.quiz-opt::before {
  content: attr(data-letter);
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(181, 123, 255, 0.2);
  border: 1px solid var(--hairline);
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--lilac);
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.quiz-opt:active {
  transform: scale(0.99);
}
@media (hover: hover) and (pointer: fine) {
  .quiz-opt:hover {
    border-color: var(--bubble);
    background: rgba(255, 62, 165, 0.1);
  }
}
.quiz-opt.picked {
  border-color: var(--bubble);
  background: rgba(255, 62, 165, 0.18);
}
.quiz-opt.picked::before {
  content: '✓';
  background: var(--bubble);
  border-color: var(--bubble);
  color: #fff;
}

.quiz-back {
  margin: 16px 0 0;
  background: none;
  border: 0;
  padding: 10px 2px;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  color: var(--muted);
  cursor: pointer;
}
.quiz-back:hover {
  color: var(--cyber);
}
.quiz-back[hidden] {
  display: none;
}

/* ----------------------------------------------------------- results ---- */

.quiz-result {
  text-align: center;
}
.quiz-result-kicker {
  font-family: var(--f-mono);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyber);
  margin: 0 0 6px !important;
}
.quiz-mark {
  font-size: 3.2rem;
  line-height: 1;
  margin: 0 0 6px !important;
  color: var(--zap);
  filter: drop-shadow(0 0 16px var(--bubble));
}
.quiz-result h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2rem, 9vw, 2.8rem);
  line-height: 1.05;
  margin: 0 0 12px;
  background: linear-gradient(174deg, #fff 10%, var(--shock) 55%, var(--lilac) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.quiz-result h2::after {
  display: none; /* the section rule from doc.css doesn't belong here */
}
.quiz-blurb {
  color: #d6cbe8;
  font-size: 1rem;
  line-height: 1.7;
  margin: 0 0 18px !important;
}

.quiz-traits {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.quiz-traits li {
  font-family: var(--f-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--lilac);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  padding: 6px 13px;
  background: rgba(11, 6, 20, 0.5);
}

.quiz-cta {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.28rem;
  line-height: 1.35;
  margin: 0 0 16px !important;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.quiz-ghost {
  min-height: 48px;
  padding: 0 20px;
  background: none;
  color: var(--muted);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.14s ease, color 0.14s ease;
}
.quiz-ghost:hover {
  border-color: var(--cyber);
  color: var(--cyber);
}

@media (prefers-reduced-motion: reduce) {
  .quiz-card.enter {
    animation: none;
  }
  .quiz-bar i {
    transition: none;
  }
}
