/*
 * Quiz player. Every question on one scrolling page: a colour block with the
 * question, a grid of answer tiles under it, and a result card at the bottom.
 *
 * Colour: each question takes one hue family and uses it tone on tone:
 * --vivid (block), --deep (text and the picked tile), --tint and --wash (tiles).
 * All families share the same lightness steps, so any two sit together.
 * Green and red are kept for right and wrong. Flat colour only.
 */
@font-face {
  font-family: "Bricolage";
  src: url("../fonts/Bricolage-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Bricolage";
  src: url("../fonts/Bricolage-ExtraBold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

.single-quiz .entry-header,
.single-quiz .entry-content > p,
.single-quiz .entry-content > .code-block { max-width: 680px; margin-left: auto; margin-right: auto; }
.single-quiz .entry-header .page-title,
.single-quiz .entry-header .entry-title {
  font-family: "Bricolage", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.04;
  color: #231440;
}

.pq {
  --vivid: #b795ff;
  --deep: #231440;
  --tint: #e1d5ff;
  --tint2: #d4c6ff;
  --wash: #f1ecff;
  --night: #1b0f36;
  --sun: #fede23;
  --sun-deep: #2a1e00;
  --ok: #6ce98d;
  --ok-deep: #002907;
  --ok-wash: #e7f9ea;
  --no: #ff7a73;
  --no-deep: #3d090a;
  --no-wash: #ffedea;
  --mute: #5d6473;
  --r: 14px;
  --pq-font: "Bricolage", system-ui, -apple-system, "Segoe UI", sans-serif;
  max-width: 680px;
  margin: 24px auto 48px;
  color: var(--deep);
  font-family: var(--pq-font);
  font-weight: 600;
}
.pq-h1 { --vivid: #fede23; --deep: #2a1e00; --tint: #fbec9c; --tint2: #f6e27a; --wash: #fdf7d2; }
.pq-h2 { --vivid: #6abfff; --deep: #002142; --tint: #c1e3ff; --tint2: #aed6f9; --wash: #e2f3ff; }
.pq-h3 { --vivid: #ff7eb6; --deep: #3a0921; --tint: #ffcbe0; --tint2: #ffbad4; --wash: #ffe7f1; }
.pq-h4 { --vivid: #5ce4d5; --deep: #002a24; --tint: #b9eae2; --tint2: #a5ded6; --wash: #dff6f2; }

.pq *, .pq *::before, .pq *::after { box-sizing: border-box; }
.pq button { -webkit-tap-highlight-color: transparent; font-family: inherit; }
.pq noscript ol { padding-left: 1.2em; font-family: inherit; }
.pq [hidden] { display: none !important; }

.pq-friend { margin: 0 0 16px; padding: 16px 20px; border-radius: var(--r); background: var(--night); color: #fff; font-size: 16.5px; line-height: 1.35; }

/* Question block */
.pq-q { margin: 0 0 52px; scroll-margin-top: 14px; }
.pq-q-img { display: block; width: 100%; max-height: 400px; object-fit: cover; border-radius: var(--r) var(--r) 0 0; }
.pq-q-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: clamp(180px, 38vw, 260px);
  padding: 34px 30px 40px;
  border-radius: var(--r);
  background: var(--vivid);
  color: var(--deep);
  text-align: center;
}
.pq-q-img + .pq-q-head { border-radius: 0 0 var(--r) var(--r); min-height: 0; padding: 24px; }
.pq-q-num {
  padding: 6px 12px 5px;
  border-radius: 99px;
  background: var(--deep);
  color: var(--vivid);
  font-size: 13px;
  line-height: 1;
  letter-spacing: .06em;
  font-variant-numeric: tabular-nums;
}
.pq .pq-q-text {
  margin: 0;
  color: inherit;
  font-family: var(--pq-font);
  font-weight: 800;
  font-size: clamp(27px, 6vw, 44px);
  line-height: 1.04;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.pq-missed .pq-q-head { outline: 4px solid var(--deep); outline-offset: 4px; }

/* Answer tiles */
.pq-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.pq-answers .pq-a:last-child:nth-child(odd) { grid-column: 1 / -1; }
.pq-answers.pq-long { grid-template-columns: 1fr; }
.pq .pq-a {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 96px;
  padding: 16px 14px;
  border: 0;
  border-radius: var(--r);
  background: var(--tint);
  color: var(--deep);
  font-weight: 600;
  font-size: 17.5px;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease, opacity .2s ease, transform .12s ease;
}
.pq-long .pq-a { min-height: 64px; justify-content: flex-start; text-align: left; padding: 14px 20px; }
.pq .pq-a:hover:not(:disabled):not(.pq-picked) { background: var(--tint2); }
.pq .pq-a:active:not(:disabled) { transform: scale(.985); }
.pq .pq-a:focus-visible, .pq .pq-item:focus-visible, .pq .pq-btn:focus-visible, .pq .pq-ico:focus-visible, .pq .pq-retake:focus-visible { outline: 3px solid var(--deep); outline-offset: 2px; }
.pq-result .pq-ico:focus-visible, .pq-result .pq-retake:focus-visible { outline-color: #fff; }
.pq .pq-a:disabled { cursor: default; }
.pq-a-label { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; }

/* The tick box: shown on picture tiles and checklist rows */
.pq-mark {
  flex: none;
  position: relative;
  width: 22px;
  height: 22px;
  border: 2px solid var(--deep);
  border-radius: 6px;
  background: #fff;
}
.pq-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid var(--deep);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
  opacity: 0;
}
.pq-answers:not(.pq-answers-img) .pq-mark { display: none; }

.pq .pq-a.pq-picked { background: var(--deep); color: #fff; }
.pq-a.pq-picked .pq-mark, .pq-item.pq-on .pq-mark { background: var(--vivid); border-color: var(--vivid); }
.pq-a.pq-picked .pq-mark::after, .pq-item.pq-on .pq-mark::after { opacity: 1; }
.pq-answered .pq-a:not(.pq-picked):not(.pq-right):not(.pq-voted) { opacity: .5; }
.pq-answered .pq-answers-img .pq-a:not(.pq-picked):not(.pq-right):not(.pq-voted) { opacity: .62; }

/* Trivia */
.pq .pq-a.pq-right { background: var(--ok); color: var(--ok-deep); opacity: 1; }
.pq .pq-a.pq-wrong { background: var(--no); color: var(--no-deep); }
.pq-a.pq-right .pq-mark { background: #fff; border-color: var(--ok-deep); }
.pq-a.pq-right .pq-mark::after { border-color: var(--ok-deep); opacity: 1; }
.pq-a.pq-wrong .pq-mark { background: #fff; border-color: var(--no-deep); }
.pq-a.pq-wrong .pq-mark::after { opacity: 0; }

/* Poll: each tile fills to its share of the vote */
.pq .pq-a.pq-voted { flex-direction: column-reverse; gap: 4px; background: var(--wash); color: var(--deep); opacity: 1; }
.pq .pq-a.pq-voted::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--pq-fill, 0%);
  background: var(--tint);
  transition: width .8s cubic-bezier(.22, 1, .36, 1);
}
.pq .pq-a.pq-voted.pq-picked::before { background: var(--vivid); }
.pq-pct { position: relative; z-index: 1; font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pq-long .pq-a.pq-voted { flex-direction: row; justify-content: space-between; gap: 14px; }

/* Picture tiles: photo on top, tick box and label under it */
.pq-answers-img.pq-n3, .pq-answers-img.pq-n6 { grid-template-columns: repeat(3, 1fr); }
.pq .pq-answers-img .pq-a { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; min-height: 0; padding: 0; text-align: left; }
.pq-a-img { flex: none; display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.pq-answers-img.pq-n3 .pq-a-img, .pq-answers-img.pq-n6 .pq-a-img { aspect-ratio: 1 / 1; }
.pq-answers-img .pq-a:last-child:nth-child(odd) .pq-a-img { aspect-ratio: 2 / 1; }
.pq-answers-img.pq-n3 .pq-a:last-child { grid-column: auto; }
.pq-answers-img.pq-n3 .pq-a:last-child .pq-a-img { aspect-ratio: 1 / 1; }
.pq-answers-img .pq-a-label { flex: 1; padding: 13px 13px 14px; font-size: 16.5px; line-height: 1.2; }
.pq-answers-img .pq-a.pq-voted { flex-direction: column; gap: 0; background: var(--tint); }
.pq-answers-img .pq-a.pq-voted::before { display: none; }
.pq-answers-img .pq-a.pq-voted.pq-picked { background: var(--deep); color: #fff; }
.pq-answers-img .pq-pct { position: absolute; left: 10px; top: 10px; padding: 7px 11px 6px; border-radius: 99px; background: #fff; color: var(--deep); font-size: 20px; letter-spacing: -.02em; }
.pq-answers-img .pq-a.pq-picked .pq-pct { background: var(--vivid); }

/* Shown under the tiles after an answer */
.pq-fb { margin-top: 8px; padding: 18px 20px; border-radius: var(--r); background: var(--wash); color: var(--deep); animation: pq-up .3s ease both; }
.pq-fb-ok { background: var(--ok-wash); color: var(--ok-deep); }
.pq-fb-no { background: var(--no-wash); color: var(--no-deep); }
.pq-verdict { display: block; font-weight: 800; font-size: 24px; line-height: 1.1; letter-spacing: -.02em; }
.pq .pq-explain { margin: 6px 0 0; font-family: var(--theme-font-family, inherit); font-weight: 400; font-size: 16.5px; line-height: 1.45; color: inherit; }
.pq .pq-stat { margin: 8px 0 0; font-size: 15px; color: inherit; opacity: .7; }
.pq .pq-fb .pq-stat:first-child { margin: 0; opacity: 1; font-size: 16.5px; }

.pq .pq-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 22px;
  border: 0;
  border-radius: 99px;
  background: var(--sun);
  color: var(--sun-deep);
  font-weight: 800;
  font-size: 16.5px;
  line-height: 1;
  cursor: pointer;
}
.pq .pq-btn:hover { background: #fff; }

/* Checklist: one tick-box row per item */
.pq-check { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.pq .pq-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 0;
  border-radius: var(--r);
  background: var(--tint);
  color: var(--deep);
  font-weight: 600;
  font-size: 16.5px;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.pq .pq-item:hover:not(.pq-on) { background: var(--tint2); }
.pq .pq-item.pq-on { background: var(--deep); color: #fff; }
.pq-check-done {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 8px 8px 8px 22px;
  border-radius: 99px;
  background: var(--night);
  color: #fff;
}
.pq-finished .pq-check-done { display: none; }
.pq-count { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }

/* Result card: the one dark block on the page */
.pq-result { position: relative; scroll-margin-top: 14px; }
.pq-hero { padding: 34px 32px 30px; border-radius: 22px; background: var(--night); color: #fff; animation: pq-pop .4s cubic-bezier(.2, .9, .3, 1.15) both; }
.pq .pq-hero-quiz { margin: 0 0 22px; font-size: 13px; line-height: 1.3; letter-spacing: .08em; text-transform: uppercase; color: #a893d6; }
.pq .pq-hero-k { display: inline-block; margin: 0; padding: 7px 13px 6px; border-radius: 99px; background: var(--sun); color: var(--sun-deep); font-weight: 800; font-size: 15px; line-height: 1; }
.pq .pq-score { margin: 0; font-weight: 800; font-size: 22px; line-height: 1.1; color: #fff; }
.pq-score b { font-weight: 800; font-size: 3.2em; line-height: .9; letter-spacing: -.04em; color: var(--sun); vertical-align: -.06em; margin: 0 .04em; }
.pq .pq-hero-t { margin: 14px 0 0; color: #fff; font-family: var(--pq-font); font-weight: 800; font-size: clamp(38px, 9vw, 64px); line-height: .98; letter-spacing: -.035em; text-wrap: balance; }
.pq-hero-img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin: 24px 0 0; border-radius: var(--r); }
.pq .pq-hero-d { margin: 20px 0 0; font-family: var(--theme-font-family, inherit); font-weight: 400; font-size: 18px; line-height: 1.5; color: #e9e3f7; }
.pq .pq-hero-stat { margin: 14px 0 0; font-size: 15.5px; color: var(--vivid); }

.pq-share { margin-top: 28px; }
.pq-share-k { display: block; margin-bottom: 10px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #a893d6; }
.pq-share-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pq .pq-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 10px;
  border: 0;
  border-radius: 99px;
  background: #33245a;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
}
.pq .pq-ico:hover { background: #46347a; color: #fff; }
.pq .pq-s-fb { background: var(--sun); color: var(--sun-deep); }
.pq .pq-s-fb:hover { background: #fff; color: var(--sun-deep); }
.pq .pq-s-copy.pq-copied { background: var(--ok); color: var(--ok-deep); }
.pq-ico svg { flex: none; width: 20px; height: 20px; fill: currentColor; }
.pq .pq-retake { display: block; width: 100%; min-height: 44px; margin: 14px 0 0; padding: 8px 14px; border: 0; background: none; color: var(--vivid); font-weight: 800; font-size: 15.5px; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.pq .pq-retake:hover { color: #fff; }

.pq-more { margin-top: 34px; }
.pq .pq-more-h { margin: 0 0 6px; font-family: var(--pq-font); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.pq .pq-more-card { display: flex; align-items: center; gap: 14px; padding: 10px 0; text-decoration: none; color: var(--deep); font-size: 17.5px; line-height: 1.2; }
.pq .pq-more-card:hover .pq-more-t { text-decoration: underline; text-underline-offset: 3px; }
.pq-more-card img { flex: none; width: 104px; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 8px; }

.pq-confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 3; }
.pq-confetti i { position: absolute; top: -16px; width: 9px; height: 14px; border-radius: 2px; opacity: 0; animation: pq-fall 2s cubic-bezier(.2, .6, .4, 1) forwards; }

@keyframes pq-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pq-pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pq-fall {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--pq-drift, 0), 460px) rotate(var(--pq-spin, 360deg)); }
}

@media (min-width: 641px) {
  .pq-answers-img.pq-n5 { grid-template-columns: repeat(6, 1fr); }
  .pq-answers-img.pq-n5 .pq-a { grid-column: span 2; }
  .pq-answers-img.pq-n5 .pq-a:nth-child(n+4) { grid-column: span 3; }
  .pq-answers-img.pq-n5 .pq-a:nth-child(n+4) .pq-a-img { aspect-ratio: 3 / 2; }
}
@media (max-width: 640px) {
  .pq { --r: 12px; }
  .pq-q { margin-bottom: 40px; }
  .pq-q-head { gap: 14px; padding: 26px 18px 32px; }
  .pq .pq-answers:not(.pq-answers-img) .pq-a { min-height: 88px; padding: 14px 10px; font-size: 16.5px; }
  .pq .pq-answers.pq-long .pq-a { min-height: 60px; padding: 13px 16px; }
  .pq-answers-img.pq-n3, .pq-answers-img.pq-n6 { grid-template-columns: 1fr 1fr; }
  .pq-answers-img.pq-n3 .pq-a:last-child { grid-column: 1 / -1; }
  .pq-answers-img.pq-n3 .pq-a:last-child .pq-a-img { aspect-ratio: 2 / 1; }
  .pq-answers-img .pq-a-label { padding: 11px; font-size: 15.5px; }
  .pq-check { grid-template-columns: 1fr; }
  .pq-hero { padding: 26px 20px 22px; border-radius: 18px; }
  .pq-share-row { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .pq *, .pq *::before, .pq *::after { transition: none !important; animation: none !important; }
}
