/* Public quiz catalogue and player share the live Gods of Logic palette. */
.quiz-page { min-height: 76vh; padding: 14px 0 32px; color: var(--ink, #35140d); background: radial-gradient(ellipse at 50% 76%, #fbf6ec 0, #fffdf8 72%); }
.quiz-catalogue { width: 80%; max-width: 1120px; margin: 0 auto; }
.quiz-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.quiz-heading { min-width: 0; }
.quiz-heading h1 { color: var(--ink, #35140d); font-size: clamp(27px, 3vw, 38px); font-weight: 600; letter-spacing: -.9px; line-height: 1.04; text-wrap: balance; }
.quiz-heading p { margin-top: 2px; color: #3f3732; font-size: clamp(12px, 1.2vw, 15px); line-height: 1.35; }
.quiz-search { display: flex; flex: 0 0 clamp(155px, 20vw, 220px); align-items: center; height: 38px; padding: 0 9px 0 11px; border: 1px solid #ded8d0; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px #35140d0a; }
.quiz-search:focus-within { border-color: #c78b24; box-shadow: 0 0 0 3px #ffcc3538; }
.quiz-search input { width: 100%; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink, #35140d); font-size: 11px; }
.quiz-search input::placeholder { color: #8a817b; opacity: 1; }
.quiz-search button { display: grid; flex: 0 0 25px; width: 25px; height: 30px; place-items: center; padding: 0; border: 0; background: transparent; }
.quiz-search button span { position: relative; width: 10px; height: 10px; border: 1.5px solid #8a817b; border-radius: 50%; }
.quiz-search button span::after { position: absolute; right: -5px; bottom: -3px; width: 5px; height: 1.5px; border-radius: 2px; background: #8a817b; content: ''; transform: rotate(45deg); transform-origin: left center; }
.quiz-filters { display: flex; gap: 6px; max-width: 100%; margin: 11px 0 9px; overflow-x: auto; scrollbar-width: none; }
.quiz-filters::-webkit-scrollbar { display: none; }
.quiz-filter { display: inline-flex; flex: 0 0 auto; min-height: 27px; align-items: center; justify-content: center; padding: 4px 13px; border: 1px solid #e7dfd4; border-radius: 999px; background: #fffefa; color: #37251e; font-size: 10px; line-height: 1.1; white-space: nowrap; transition: background-color .16s ease, border-color .16s ease, transform .16s ease; }
.quiz-filter:hover { border-color: #eccb80; background: #fff8e6; }
.quiz-filter.is-active { border-color: #ffd674; background: #ffda7a; color: #35140d; }
.quiz-filter:focus-visible, .quiz-card-link:focus-visible, .quiz-pagination a:focus-visible { outline: 3px solid #006bb4; outline-offset: 3px; }
.quiz-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px 10px; }
.quiz-card { min-width: 0; overflow: hidden; border: 1px solid #f0e8da; border-radius: 9px; background: #fff; box-shadow: 0 4px 15px #35140d0c; transition: transform .18s ease, box-shadow .18s ease; }
.quiz-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px #35140d16; }
.quiz-card-link { display: flex; height: 100%; min-width: 0; flex-direction: column; color: inherit; text-decoration: none; }
.quiz-card-image { width: 100%; aspect-ratio: 2.12 / 1; overflow: hidden; background: #fbf1db; }
.quiz-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.quiz-card:hover .quiz-card-image img { transform: scale(1.035); }
.quiz-card-body { display: flex; flex: 1; min-width: 0; flex-direction: column; padding: 6px 8px 7px; }
.quiz-tag { align-self: flex-start; max-width: 100%; overflow: hidden; padding: 2px 6px; border-radius: 999px; background: #ffe7ae; color: #6f3d13; font-size: 8px; font-weight: 700; line-height: 1.2; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.quiz-card h2 { display: -webkit-box; min-height: 2.25em; margin-top: 3px; overflow: hidden; color: #261913; font-size: clamp(11px, 1.13vw, 15px); font-weight: 600; line-height: 1.12; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.quiz-card-description { display: -webkit-box; min-height: 2.3em; margin-top: 2px; overflow: hidden; color: #6c625c; font-size: clamp(9px, .91vw, 12px); line-height: 1.18; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.quiz-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin-top: auto; padding-top: 5px; }
.quiz-meta { display: flex; min-width: 0; align-items: center; gap: clamp(5px, .8vw, 11px); color: #6d6864; font-size: clamp(8px, .78vw, 10px); white-space: nowrap; }
.quiz-meta span { min-width: 0; }
.quiz-play-label { display: inline-flex; flex: 0 0 auto; min-height: 28px; align-items: center; justify-content: center; gap: 5px; padding: 5px 9px; border: 1px solid #f3cd67; border-radius: 999px; background: #ffda76; color: #3c2a09; font-size: clamp(9px, .83vw, 11px); font-weight: 600; line-height: 1; white-space: nowrap; }
.quiz-play-label span { font-size: 16px; line-height: .7; }
.quiz-card-link:hover .quiz-play-label { background: #ffcd4e; }
.quiz-pagination { display: flex; width: 100%; min-height: 29px; align-items: center; justify-content: center; gap: 6px; margin: 10px auto 0; }
.quiz-pagination a, .quiz-pagination span { display: inline-flex; width: 29px; height: 29px; align-items: center; justify-content: center; border: 1px solid #e9e3da; border-radius: 7px; background: #fff; color: #35231b; font-size: 11px; text-decoration: none; }
.quiz-pagination .page-arrow { font-size: 18px; }
.quiz-pagination .page-number.is-current { border-color: #ffd36c; background: #ffda76; font-weight: 700; }
.quiz-pagination .is-disabled { color: #b4ada4; }
.quiz-empty { margin-top: 22px; padding: 30px 18px; border: 1px solid #f0e8da; border-radius: 12px; background: #fff; text-align: center; }
.quiz-empty h2 { color: var(--ink, #35140d); font-size: 21px; font-weight: 600; }
.quiz-empty p { margin: 5px 0 13px; color: #6c625c; font-size: 14px; }

.quiz-play-page { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: min(740px, calc(100% - 32px)); min-height: 70vh; margin: 20px auto 0; padding: 24px clamp(22px, 4vw, 46px) 36px; border: 1px solid #f2e8da; border-radius: 24px; background: #fffdf8; box-shadow: 0 12px 35px #35140d0b; color: var(--ink, #35140d); }
.quiz-back { display: grid; grid-column: 1; width: 40px; height: 40px; place-items: center; border: 1px solid #eee5d9; border-radius: 50%; background: #fff; color: #5b3724; font-size: 27px; line-height: 1; text-decoration: none; }
.quiz-play-title { display: flex; grid-column: 2; grid-row: 1; align-items: center; justify-content: flex-end; gap: 16px; }
.quiz-play-title h1 { color: #35140d; font-size: clamp(25px, 3vw, 34px); font-weight: 600; letter-spacing: -.5px; line-height: 1.1; text-align: right; }
.quiz-trophy { color: #edae1b; font-size: 28px; }
.quiz-play-status { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 12px; margin: 15px 0 16px; }
.quiz-question-count, .quiz-timer { display: inline-flex; min-height: 36px; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff4e3; color: #64452e; font-size: 13px; white-space: nowrap; }
.quiz-timer { background: #fff5df; color: #9a6412; font-weight: 700; }
.quiz-fullscreen-toggle { display: grid; width: 36px; height: 36px; flex: 0 0 36px; place-items: center; border: 1px solid #f0ddc5; border-radius: 50%; background: #fff; color: #68472d; font-size: 22px; line-height: 1; cursor: pointer; }
.quiz-fullscreen-toggle:focus-visible { outline: 2px solid #d59b22; outline-offset: 2px; }
.quiz-fullscreen-message { grid-column: 1 / -1; margin: -7px 0 8px; color: #76562c; font-size: 12px; line-height: 1.4; text-align: center; }
.quiz-play-cover { display: block; grid-column: 1 / -1; width: 100%; max-height: 330px; aspect-ratio: 2.12 / 1; margin: 0 0 18px; border-radius: 18px; background: #fbf1db; object-fit: cover; }
.quiz-play-form { display: contents; }
.quiz-progress { height: 6px; overflow: hidden; border-radius: 999px; background: #efe9de; }
.quiz-progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: #e9ac22; transition: width .2s ease; }
.quiz-progress, .quiz-progress-label { display: none; }
.quiz-question { display: block; grid-column: 1 / -1; min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; }
.quiz-question[hidden] { display: none; }
.quiz-question legend { max-width: 100%; margin-bottom: 12px; padding: 0; color: #35140d; font-size: clamp(22px, 2.7vw, 29px); font-weight: 700; line-height: 1.25; }
.quiz-answer { display: flex; min-height: 52px; align-items: center; gap: 12px; margin-top: 8px; padding: 8px 13px; border: 1px solid #eee8df; border-radius: 999px; background: #fffefa; color: #40332d; cursor: pointer; font-size: 16px; transition: background .15s, border-color .15s; }
.quiz-answer:hover { border-color: #dfc58d; background: #fff9e8; }
.quiz-answer input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.quiz-answer-letter { display: grid; flex: 0 0 27px; width: 27px; height: 27px; place-items: center; border-radius: 50%; background: #f3e5d2; color: #674329; font-weight: 700; }
.quiz-answer-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.quiz-answer > i { width: 18px; height: 18px; flex: 0 0 18px; border: 2px solid #ead9c2; border-radius: 50%; background: #fff; }
.quiz-answer:has(input:checked) { border-color: #ffc83f; background: #fff1c8; }
.quiz-answer:has(input:checked) .quiz-answer-letter { background: #ffd15f; color: #553609; }
.quiz-answer:has(input:checked) > i { border: 4px solid #f5b915; }
.quiz-answer.is-correct { border-color: #a9cbb0; background: #f1f8f0; color: #28523a; }
.quiz-answer.is-incorrect { border-color: #e7b4a8; background: #fff1ed; color: #873d30; }
.quiz-answer.is-correct:has(input:checked) { border-color: #74ad81; background: #e5f4e7; color: #28523a; }
.quiz-answer.is-incorrect:has(input:checked) { border-color: #d88b7b; background: #ffebe6; color: #873d30; }
.quiz-answer-feedback { min-height: 0; margin-top: 5px; color: #61564e; font-size: 12px; font-weight: 600; }
.quiz-completion { display: grid; grid-column: 1 / -1; width: 100%; min-width: 0; gap: 12px; justify-items: center; padding: clamp(18px, 4vw, 30px); border: 1px solid #f0e3cd; border-radius: 18px; background: linear-gradient(145deg, #fffaf0, #fff3dc); text-align: center; }
.quiz-completion[hidden] { display: none; }
.quiz-completion-kicker { margin: 0; color: #9b681a; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.quiz-completion h2 { margin: 0; color: #35140d; font-size: clamp(22px, 4vw, 30px); line-height: 1.15; }
.quiz-score { width: 100%; max-width: 34ch; margin: 0; color: #51351e; font-size: clamp(15px, 2.5vw, 19px); font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.quiz-review { display: grid; width: 100%; gap: 8px; margin-top: 4px; text-align: left; }
.quiz-review-item { min-width: 0; padding: 11px 13px; border: 1px solid #e8dfd2; border-radius: 12px; background: #fff; }
.quiz-review-item h3 { margin: 0 0 6px; color: #483326; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.quiz-review-item p { margin: 3px 0 0; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.quiz-review-your-answer { color: #6a5543; }
.quiz-review-correct-answer { color: #287044; font-weight: 700; }
.quiz-review-item.is-correct { border-color: #c9dfcb; background: #f5fbf4; }
.quiz-review-item.is-correct h3 { color: #287044; }
.quiz-review-item.is-incorrect { border-color: #efd4ca; background: #fff8f5; }
.quiz-review-item.is-incorrect h3 { color: #a24735; }
.quiz-completion .quiz-restart { min-width: 150px; }
.quiz-play-page:fullscreen, .quiz-play-page.is-expanded { position: fixed; z-index: 1000; inset: 0; box-sizing: border-box; width: 100%; max-width: none; height: 100vh; height: 100dvh; min-height: 100vh; min-height: 100dvh; align-content: start; gap: 0; overflow-y: auto; margin: 0; padding: clamp(14px, 3vw, 32px) max(16px, calc((100vw - 740px) / 2)); border: 0; border-radius: 0; background: #fffaf0; box-shadow: none; }
.quiz-play-page:fullscreen .quiz-play-cover, .quiz-play-page.is-expanded .quiz-play-cover { max-height: min(36vh, 320px); }
.quiz-play-page:fullscreen .quiz-completion, .quiz-play-page.is-expanded .quiz-completion { justify-self: center; max-width: 740px; }
.quiz-play-actions { display: flex; grid-column: 1 / -1; justify-content: space-between; gap: 10px; margin-top: 18px; }
.quiz-previous, .quiz-next, .quiz-submit, .quiz-restart { display: inline-flex; min-width: 145px; min-height: 48px; align-items: center; justify-content: center; gap: 10px; padding: 10px 20px; border: 1px solid #f0ddc5; border-radius: 999px; background: #f5e7d5; color: #54351f; font: inherit; font-weight: 700; cursor: pointer; }
.quiz-next, .quiz-submit { border-color: #ffc538; background: linear-gradient(180deg, #ffd044, #ffba1d); color: #402b0e; }
.quiz-previous:disabled { opacity: .55; cursor: not-allowed; }
.quiz-restart { border-color: #e4d6c4; background: #fff; }
.quiz-submit:focus-visible, .quiz-restart:focus-visible { outline: 3px solid #d59b22; outline-offset: 3px; }
.quiz-answer:focus-within { outline: none; box-shadow: 0 0 0 2px #e8bf61; }
.quiz-play-form [hidden] { display: none !important; }

@media (min-width: 1200px) {
  .quiz-page { padding-top: 20px; }
  .quiz-filters { margin-top: 14px; margin-bottom: 11px; }
  .quiz-grid { gap: 15px 14px; }
  .quiz-card-body { padding: 9px 12px 10px; }
}
@media (max-width: 700px) {
  .quiz-page { padding-top: 16px; }
  .quiz-catalogue { width: calc(100% - 28px); }
  .quiz-toolbar { align-items: stretch; flex-direction: column; gap: 11px; }
  .quiz-heading h1 { font-size: clamp(28px, 8vw, 36px); }
  .quiz-heading p { max-width: 42ch; font-size: 13px; }
  .quiz-search { flex-basis: auto; width: 100%; height: 42px; }
  .quiz-search input { font-size: 13px; }
  .quiz-filters { gap: 7px; margin: 12px 0 10px; padding: 1px 2px 4px; }
  .quiz-filter { min-height: 32px; padding-inline: 13px; font-size: 11px; }
  .quiz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .quiz-card-body { padding: 7px 8px 8px; }
  .quiz-tag { font-size: 9px; }
  .quiz-card h2 { min-height: 2.25em; font-size: clamp(12px, 3.6vw, 15px); }
  .quiz-card-description { min-height: 2.36em; font-size: clamp(10px, 2.9vw, 12px); }
  .quiz-meta { flex-direction: column; align-items: flex-start; gap: 2px; font-size: 10px; }
  .quiz-play-label { min-height: 34px; padding-inline: 9px; font-size: 10px; }
  .quiz-pagination { margin-top: 14px; }
  .quiz-play-page { display: grid; grid-template-columns: 32px minmax(0, 1fr) 24px; width: calc(100% - 8px); min-height: 0; margin: 4px auto 0; padding: 8px 11px 10px; border: 1px solid #efe7dc; border-radius: 23px; background: linear-gradient(180deg, #fffaf0 0%, #fff5e1 100%); box-shadow: 0 7px 24px #51351b0d; }
  .quiz-back { width: 27px; height: 27px; grid-column: 1; grid-row: 1; font-size: 22px; }
  .quiz-play-title { display: contents; }
  .quiz-play-title h1 { grid-column: 2; grid-row: 1; align-self: center; justify-self: center; font-size: clamp(21px, 6vw, 27px); text-align: center; }
  .quiz-trophy { grid-column: 3; grid-row: 1; justify-self: end; font-size: 20px; }
  .quiz-play-status { grid-column: 1 / -1; margin: 9px 0 10px; }
  .quiz-question-count, .quiz-timer { min-height: 34px; padding: 6px 11px; font-size: 12px; }
  .quiz-fullscreen-toggle { width: 34px; height: 34px; flex-basis: 34px; font-size: 20px; }
  .quiz-play-cover { grid-column: 1 / -1; max-height: none; aspect-ratio: 2.12 / 1; margin-bottom: 9px; border-radius: 11px; }
  .quiz-question { grid-column: 1 / -1; }
  .quiz-question legend { margin-bottom: 10px; font-size: clamp(20px, 5.8vw, 25px); line-height: 1.22; }
  .quiz-answer { min-height: 49px; gap: 12px; margin-top: 8px; padding: 7px 11px; font-size: 15px; }
  .quiz-answer-letter { flex-basis: 28px; width: 28px; height: 28px; font-size: 14px; }
  .quiz-answer > i { width: 18px; height: 18px; flex-basis: 18px; }
  .quiz-answer-feedback { margin-top: 8px; font-size: 14px; line-height: 1.45; }
  .quiz-play-actions { grid-column: 1 / -1; gap: 10px; margin-top: 19px; }
  .quiz-previous, .quiz-next, .quiz-submit, .quiz-restart { min-width: 0; min-height: 50px; flex: 1; padding: 10px 14px; font-size: 15px; }
  .quiz-completion { gap: 9px; padding: 16px 12px; border-radius: 15px; }
  .quiz-review { gap: 7px; }
  .quiz-review-item { padding: 9px 10px; }
  .quiz-review-item h3 { font-size: 15px; }
  .quiz-review-item p { font-size: 14px; }
  .quiz-play-page:fullscreen, .quiz-play-page.is-expanded { width: 100%; padding: 8px 11px max(12px, env(safe-area-inset-bottom)); border-radius: 0; }
  .quiz-play-page:fullscreen .quiz-play-cover, .quiz-play-page.is-expanded .quiz-play-cover { max-height: 28vh; }
}
@media (max-width: 340px) {
  .quiz-grid { grid-template-columns: 1fr; }
  .quiz-card-image { aspect-ratio: 2.5 / 1; }
  .quiz-meta { flex-direction: row; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .quiz-card, .quiz-card-image img, .quiz-progress span { transition: none; }
}

/* The launch shell keeps the same document alive during native fullscreen. */
.quiz-app-shell { position: fixed; inset: 0; z-index: 1200; width: 100%; height: 100dvh; background: #fffaf0; overflow: auto; }
.quiz-app-shell:fullscreen { width: 100%; height: 100%; }
body.quiz-session-open { overflow: hidden; }
.quiz-app-loading { display: grid; min-height: 100dvh; place-content: center; color: #51351e; font-size: 18px; }
.quiz-entry { grid-column: 1 / -1; display: grid; justify-items: center; gap: 16px; padding: 24px 0; text-align: center; }
.quiz-entry[hidden] { display: none; }
.quiz-entry img { width: 100%; max-height: 38dvh; object-fit: cover; border-radius: 18px; }
.quiz-entry h2 { font-size: 28px; color: #35140d; }
.quiz-entry p { font-size: 16px; color: #76562c; }
.quiz-entry .quiz-next { min-width: 200px; min-height: 54px; font-size: 17px; }
.quiz-play-page.is-waiting .quiz-play-status,
.quiz-play-page.is-waiting .quiz-fullscreen-message,
.quiz-play-page.is-waiting > .quiz-play-cover,
.quiz-play-page.is-waiting .quiz-play-form > * { display: none !important; }
.quiz-play-page.is-complete > .quiz-play-cover { display: none; }
.quiz-play-page { grid-template-columns: 44px minmax(0, 1fr) 32px; }
.quiz-play-title { display: contents; }
.quiz-play-title h1 { grid-column: 2; grid-row: 1; align-self: center; text-align: center; }
.quiz-trophy { grid-column: 3; grid-row: 1; align-self: center; justify-self: end; }
.quiz-back { grid-column: 1; grid-row: 1; }
.quiz-play-actions { position: sticky; bottom: 0; padding: 10px 0 max(8px, env(safe-area-inset-bottom)); background: #fffaf0; }
.quiz-answer:focus-within { box-shadow: none; }
.quiz-answer:has(input:focus-visible) { outline: 2px solid #d59b22; outline-offset: 2px; }
.quiz-answer.is-correct .quiz-answer-letter { background: #cdebd4; color: #28523a; }
.quiz-answer.is-incorrect .quiz-answer-letter { background: #f6cfc5; color: #873d30; }
.quiz-answer.is-correct > i { background: #3e9653; border-color: #3e9653; }
.quiz-answer.is-incorrect > i { background: #c56b56; border-color: #c56b56; }
@media (max-width: 700px) {
  .quiz-play-page { grid-template-columns: 40px minmax(0, 1fr) 28px; }
  .quiz-back { width: 36px; height: 36px; }
  .quiz-play-page.is-expanded, .quiz-play-page:fullscreen { padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom)); }
  .quiz-play-status { gap: 6px; margin: 14px 0; }
  .quiz-play-cover { margin-bottom: 16px; }
  .quiz-question legend { margin-bottom: 12px; }
  .quiz-answer { min-height: 52px; }
}
