main#main:has(> [data-live-quiz-home]) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas: "training garage" "live summary";
}
main#main:has(> [data-live-quiz-home]) > .training-home:not([data-live-quiz-home]) { grid-area: training; }
main#main:has(> [data-live-quiz-home]) > [data-home-garage] { grid-area: garage; }
main#main:has(> [data-live-quiz-home]) > [data-live-quiz-home] { grid-area: live; }
main#main:has(> [data-live-quiz-home]) > .home-summary { grid-area: summary; }
main#main:has(> [data-live-quiz-home]) > .resume-note { grid-row: auto; }
[data-live-quiz-home] .home-play-actions { margin-top: 12px; }
[data-live-quiz-home] .training-selectors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-summary { display: grid; gap: 20px; }
.home-summary :is(.home-scores, .home-groups) { margin: 0; min-width: 0; }
.home-summary :is(.flame-totals, .group-rank-grid) { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.home-summary .card { padding: 12px 16px; }
.home-summary .section-head { flex-wrap: wrap; gap: 8px; }
@media (max-width: 850px) {
  main#main:has(> [data-live-quiz-home]) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "training" "live" "garage" "summary";
  }
}
@media (max-width: 460px) {
  [data-live-quiz-home] .training-selectors { grid-template-columns: minmax(0, 1fr); }
}

.live-quiz-dialog { max-width: min(960px, 96vw); }
.live-quiz-dialog [data-content] > :is(p, h3, details, form) { margin-block: 8px; }
.live-quiz-dialog [data-content] > :is(button, a) { margin: 8px 8px 0 0; }
.live-quiz-dialog [data-update] { font-weight: 700; }

.live-quiz-home-actions { display: grid; gap: 10px; margin-top: 12px; }
[data-live-quiz-home] .live-quiz-home-actions > .primary {
  width: 100%;
  min-height: 48px;
  background: #ff202f1f;
  color: #ff6370;
  box-shadow: inset 0 -2px var(--hot);
}
html[data-theme=light] [data-live-quiz-home] .live-quiz-home-actions > .primary {
  background: #ffe8e5;
  color: #a82418;
}
[data-live-quiz-home] .live-quiz-home-actions > .primary:hover { filter: brightness(1.06); }
.live-quiz-home-actions > [hidden] { display: none; }

.step4-dialog.live-quiz-presenter {
  position: fixed;
  inset: var(--live-top, auto) auto 16px var(--live-left, auto);
  right: 16px;
  margin: 0;
  width: min(420px, calc(100vw - 32px));
  max-height: 70dvh;
  overflow: auto;
  box-sizing: border-box;
  z-index: 990;
}
.step4-dialog.live-quiz-presenter.is-projected {
  inset: 0;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  border: 0;
  border-radius: 0;
  overscroll-behavior: contain;
  padding: clamp(20px, 5vw, 72px);
  font-size: clamp(1rem, 2.2vw, 2rem);
}
html:has(.live-quiz-presenter[open].is-projected) { overflow: hidden; }
.live-quiz-presenter:not(.is-projected) .dialog-top { cursor: move; touch-action: none; }
.live-quiz-nav-trigger { display: none; }
.is-projected .live-quiz-nav-trigger {
  display: block;
  position: fixed;
  inset: 0 0 auto;
  width: 100%;
  height: 16px;
  opacity: 0;
  z-index: 991;
}
header.top.live-quiz-nav-active.live-quiz-nav-visible { position: fixed; inset: 0 0 auto; z-index: 992; }
.live-quiz-podium { padding-inline-start: 1.5em; }
.live-quiz-podium > li { padding: .2em .4em; }
.live-quiz-podium > li:nth-child(-n+3) {
  margin-block: .3em;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  font-size: 1.25em;
  font-weight: 750;
}
.live-quiz-podium > li:first-child::marker { color: var(--gold); }
.live-answer-correct, .live-answer-incorrect { font-weight: 750; }

.game-correct { --edge-color: #5beb91; }
.game-incorrect { --edge-color: #f87171; }
.live-quiz-nav-trigger:focus-visible { opacity: 1; }

.live-prompt-percentages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px 16px;
  align-items: end;
}
.live-prompt-percentages > p { margin: 0; }

.live-quiz-management .live-quiz-stack { display: grid; gap: 14px; }
.live-quiz-management .live-quiz-stack fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel2);
}
.live-quiz-management .live-prompt-percentages {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr));
  align-items: start;
}
.live-quiz-management .live-prompt-percentages input { width: min(112px, 100%); }
.live-quiz-management .live-quiz-stack + section,
.live-quiz-management .live-quiz-stack + form,
.live-quiz-management .live-quiz-overview-actions,
.live-quiz-management [data-body] > .row-actions { margin-block: 12px; }
.live-quiz-management [data-history] textarea { margin-top: 8px; }
.live-quiz-management [data-history] textarea[hidden] { display: none; }
.live-quiz-management .live-quiz-wide { width: 100%; }
.live-quiz-management .live-quiz-import-thumbnail {
  display: block;
  max-width: min(160px, 100%);
  max-height: 120px;
  margin-block: 6px 12px;
  object-fit: contain;
}

.live-quiz-offer-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.live-quiz-offer-table caption { text-align: left; font-weight: 700; margin-bottom: 8px; }
.live-quiz-offer-table :is(th, td) { padding: 8px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.live-quiz-offer-table th[scope=row], .live-quiz-offer-table th:first-child { text-align: left; }
.live-quiz-offer-table td { text-align: center; }
.live-quiz-offer-table input[type=checkbox] { width: auto; min-width: 1rem; min-height: 1rem; }

.step4-dialog.live-quiz-participant { width: min(1050px, 98vw); max-width: 98vw; max-height: 96dvh; }
@media (max-width: 700px) {
  .step4-dialog.live-quiz-participant {
    inset: 0; margin: 0; width: 100%; max-width: 100%; height: 100%;
    max-height: 100%; padding: 14px; border-radius: 0;
  }
}
.step4-dialog.live-quiz-presenter .dialog-top { display: flex; gap: .65rem; align-items: center; }
.live-quiz-presenter .dialog-top h2 { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.live-quiz-presenter .dialog-top button {
  box-sizing: border-box; height: 48px; min-height: 48px; flex-shrink: 0;
  padding-block: 0; margin: 0;
}
.live-quiz-presenter [data-close] { width: 48px; padding-inline: 0; }
.live-quiz-qr { display: block; width: 100%; }
.live-quiz-qr img { display: block; width: 100%; height: auto; aspect-ratio: 1; }
.live-quiz-qr-caption { display: none; font-size: .95rem; color: var(--muted); font-weight: 650; margin-top: 6px; }
.live-quiz-presenter.is-lobby .live-quiz-qr-caption { display: block; }
.live-quiz-presenter:not(.is-projected) .dialog-top { flex-wrap: wrap; }
.live-quiz-presenter-footer { display: flex; align-items: end; justify-content: space-between; gap: .65rem; }
.live-quiz-presenter-actions { display: flex; flex-wrap: wrap; justify-content: end; align-items: end; gap: .65rem; margin-left: auto; }
.live-quiz-presenter-actions button[hidden] { display: none; }
.live-quiz-presenter-actions button { max-width: 100%; min-height: 48px; height: 48px; padding-block: 0; margin: 0; }
.live-quiz-qr-dock { flex: 0 0 auto; width: 74px; text-align: center; }
.live-quiz-lobby { text-align: center; display: grid; align-content: center; justify-items: center; gap: .36em; }
.live-quiz-lobby h3 { margin: 0 0 .6em; }
.live-quiz-lobby output {
  pointer-events: none; font-size: clamp(3rem, 10vw, 8rem); color: #1c6643;
  font-weight: 850; line-height: 1.1; font-variant-numeric: tabular-nums;
}
html[data-theme=dark] .live-quiz-lobby output { color: #85f2a7; }
.live-quiz-lobby ul, .live-quiz-outcomes {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4em;
}
.live-quiz-lobby ul { width: 100%; align-content: center; }
.live-quiz-outcomes { flex-wrap: wrap-reverse; margin-block: 1em; }
.live-quiz-lobby li, .live-quiz-outcomes li {
  border-radius: .5em; padding: .35em .65em; font-weight: 750; overflow-wrap: anywhere;
  background: var(--panel2); border: 1px solid var(--line);
}
.live-quiz-lobby li { background: #ccf3dc; color: #105430; border-color: #73ba93; }
.live-quiz-outcomes [data-result=correct] { background: #ccf3dc; color: #105430; }
.live-quiz-outcomes [data-result=wrong] { background: #ffd9d9; color: #7f1c29; }
.live-quiz-outcomes [data-result=unanswered] { background: #ffe9a0; color: #684a03; }
.live-quiz-project-question h3, .live-quiz-projection-options { font: inherit; font-weight: 700; }
.live-quiz-project-question h3 { margin: .55em 0; }
.live-quiz-projection-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,13em),1fr)); gap: .4em; }
.live-quiz-projection-options :is(.live-quiz-option,.live-quiz-solution) {
  border: 1px solid var(--line); padding: .35em .65em; border-radius: .4em;
}
.live-quiz-projection-options > div > .live-quiz-option { margin-bottom: .4em; }
.live-quiz-solution {
  background: #ccf3dc; color: #105430; font-weight: 750;
  animation: live-quiz-reveal 360ms var(--reveal-delay, 0ms) both;
}
@keyframes live-quiz-reveal {
  from { background-color: var(--panel2); color: var(--text); box-shadow: none; opacity: .85; }
  to { background-color: #ccf3dc; color: #105430; box-shadow: 0 0 .3em #1aa6666a; opacity: 1; }
}
.live-quiz-project-image { position: relative; width: fit-content; max-width: 100%; margin: .6em auto; }
.live-quiz-project-image img { display: block; max-width: 100%; max-height: 54dvh; object-fit: contain; }
.live-quiz-project-image .uq-image { margin: 0; }
.live-quiz-image-label { position: absolute; transform: translate(-50%, -100%); max-width: 42%; padding: .2em .4em;
  border-radius: .3em; border: 2px solid #187b43; text-wrap: balance; overflow-wrap: anywhere; }
.live-quiz-image-pin { position: absolute; transform: translate(-50%, -50%); width: .5em; aspect-ratio: 1; border-radius: 50%;
  background: #14733b; outline: 2px solid #ccf3dc; }
@media (prefers-reduced-motion: reduce) { .live-quiz-solution { animation: none; } }
.live-quiz-outcomes li { animation: live-quiz-outcome 450ms ease-out both; }
@keyframes live-quiz-outcome {
  from { opacity: .65; transform: translateY(5px); box-shadow: none; }
  to { opacity: 1; transform: translateY(0); box-shadow: 0 0 .3em currentColor; }
}
@media (prefers-reduced-motion: reduce) { .live-quiz-outcomes li { animation: none; } }
.step4-dialog.live-quiz-presenter.is-projected {
  --projection-pad: clamp(20px, 5vw, 72px);
  --projection-qr: min(176px, 14vw, 22dvh);
  display: flex; flex-direction: column; overflow: hidden;
  padding: clamp(20px, 4vh, 44px) var(--projection-pad);
}
.live-quiz-presenter.is-projected > [data-content] {
  flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; justify-content: safe center;
}
.live-quiz-presenter.is-projected > [data-content] > :is(.live-quiz-project-question, .live-quiz-outcomes, .live-quiz-podium, h3, [data-update]) {
  width: min(100%, 940px); align-self: center; flex-shrink: 0;
}
.live-quiz-presenter.is-projected [data-update] { font-size: .7em; margin-block: .3em; }
.live-quiz-presenter.is-projected .live-quiz-presenter-footer {
  flex-shrink: 0; padding-top: 8px;
}
.live-quiz-presenter.is-projected > .dialog-top { flex-shrink: 0; }
.live-quiz-presenter.is-projected:not(.is-open-question) .live-quiz-project-image img {
  width: auto; max-height: 38dvh;
}
.live-quiz-presenter.is-projected .live-quiz-qr-dock { width: var(--projection-qr); }
.live-quiz-presenter.is-projected.is-lobby > [data-content] { padding-inline-start: calc(2 * var(--projection-qr) + 20px); }
.live-quiz-presenter.is-projected.is-lobby .live-quiz-qr-dock {
  position: fixed; left: var(--projection-pad); top: 50%; transform: translateY(-50%);
  width: calc(2 * var(--projection-qr));
}
/* De kleine QR en de bediening staan naast de dia, buiten haar scrollgebied. */
@media (min-width: 901px) {
  .step4-dialog.live-quiz-presenter.is-projected:not(.is-lobby) {
    --projection-side: max(var(--projection-qr), min(16vw, 240px));
    display: grid;
    grid-template-columns: var(--projection-side) minmax(0, 1fr) var(--projection-side);
    grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: 1rem;
  }
  .live-quiz-presenter.is-projected:not(.is-lobby) > .dialog-top {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .live-quiz-presenter.is-projected:not(.is-lobby) > [data-content] {
    grid-column: 2;
    grid-row: 2;
  }
  .live-quiz-presenter.is-projected:not(.is-lobby) > :is([data-error], [data-update]) {
    grid-column: 2;
    grid-row: 3;
  }
  .live-quiz-presenter.is-projected:not(.is-lobby) > :is([data-error], [data-update]):empty { display: none; }
  .live-quiz-presenter.is-projected:not(.is-lobby) > .live-quiz-presenter-footer { display: contents; }
  .live-quiz-presenter.is-projected:not(.is-lobby) .live-quiz-qr-dock {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
  }
  .live-quiz-presenter.is-projected:not(.is-lobby) .live-quiz-presenter-actions {
    grid-column: 3;
    grid-row: 2;
    align-self: end;
    flex-direction: column;
  }
}
@media (max-width: 900px) {
  .step4-dialog.live-quiz-presenter.is-projected:not(.is-lobby) { overflow-y: auto; }
  .live-quiz-presenter.is-projected:not(.is-lobby) > [data-content] {
    flex: 1 0 auto;
    overflow: visible;
  }
}
@media (max-width: 700px) {
  .live-quiz-presenter.is-projected .dialog-top { flex-wrap: wrap; justify-content: end; }
  .live-quiz-presenter.is-projected .dialog-top h2 { flex-basis: 100%; }
  .live-quiz-presenter.is-projected.is-lobby > [data-content] { padding-inline-start: 0; }
  .live-quiz-presenter.is-projected.is-lobby .live-quiz-qr-dock {
    position: static; transform: none;
  }
}

.live-quiz-participation main[data-live-quiz-page] {
  min-height: 100dvh; max-width: 960px; padding: clamp(12px, 3vw, 28px); margin: 0 auto;
}
.step4-dialog.live-quiz-standalone {
  position: static; width: 100%; height: auto; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; overflow: visible;
}

@media (max-width: 700px) {
  .live-quiz-presenter-actions button { height: auto; padding-block: .45em; }
}
.live-quiz-standalone [data-content] details { margin-block: 1.2rem; }
.live-quiz-standalone [data-content] form { max-width: 31rem; }

.live-quiz-presenter .game-effect.game-reward { --edge-color: #29a9ff; }
.live-quiz-presenter .live-quiz-final-title {
  font-size: clamp(1.6rem, 3.3vw, 3rem);
  margin: 0 0 .55em;
  text-align: center;
}
.live-quiz-final-standings {
  list-style: none;
  counter-reset: live-quiz-place;
  padding: 0;
  margin: 0 auto 1rem;
  width: min(100%, 940px);
}
.live-quiz-final-empty { text-align: center; }
.live-quiz-final-standings li {
  counter-increment: live-quiz-place;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .55em;
  margin-bottom: .34em;
  padding: .35em .65em;
  border: 1px solid var(--line);
  border-radius: .5em;
  background: var(--panel2);
}
.live-quiz-final-standings li::before {
  content: counter(live-quiz-place);
  min-width: 2ch;
  text-align: center;
  font-weight: 800;
}
.live-quiz-final-standings li:nth-child(-n+3) {
  background: #ccf3dc;
  border: 2px solid #4ca16e;
  color: #105430;
}
.live-quiz-final-standings li:first-child {
  background: #bdeccc;
  border-color: #1f8551;
}
.live-quiz-final-standings strong { overflow-wrap: anywhere; }
.live-quiz-final-score {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: .65em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.live-quiz-final-score > span { white-space: nowrap; }
.live-quiz-spark-value { display: inline-flex; align-items: center; gap: .2em; }
.live-quiz-spark-icon { display: inline-flex; gap: .08em; align-items: center; }
.live-quiz-spark-icon i {
  display: inline-block;
  width: .13em;
  height: .35em;
  background: #ffca53;
  border-radius: 2px;
  box-shadow: 0 0 .12em #e98920;
  rotate: -26deg;
}
.live-quiz-spark-icon i:nth-child(2) { height: .5em; rotate: 20deg; }
.live-quiz-spark-icon i:nth-child(3) { height: .24em; rotate: 38deg; }
.live-quiz-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.live-quiz-final-brand {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: clamp(.4rem, .9vw, .8rem);
  font-size: clamp(1rem, 2.2vw, 2rem);
  max-width: 100%;
}
.live-quiz-final-brand img {
  width: clamp(36px, 5vw, 72px);
  height: auto;
}

html:has(.live-quiz-presenter[open].is-projected) [data-preference-notice] {
  inset: 6rem auto auto 50%;
  transform: translateX(-50%);
  width: max-content;
  margin: 0;
  pointer-events: none;
}
