@font-face { font-family: 'PQ Display'; src: url(fonts/pqdisplay-800.woff2) format('woff2'); font-weight: 700 900; font-display: swap; }
@font-face { font-family: 'PQ Display'; src: url(fonts/pqdisplay-600.woff2) format('woff2'); font-weight: 400 650; font-display: swap; }
:root {
  --bg: #16261e;
  --bg2: #1c3027;
  --card: #213a2f;
  --card2: #284538;
  --line: #36574a;
  --text: #f6eedb;
  --muted: #b5b9a5;
  --brass: #e8b04a;
  --brass2: #f4c76b;
  --ink: #1b1508;
  --ok: #5fcf8a;
  --bad: #ef6f5e;
  --glow: #22392d;
  --accent-soft: color-mix(in srgb, var(--brass) 22%, var(--card));
  --ok-soft: color-mix(in srgb, var(--ok) 22%, var(--card));
  --bad-soft: color-mix(in srgb, var(--bad) 18%, var(--card));
  --radius: 14px;
  --serif: 'PQ Display', Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.45 var(--sans);
  background-image: radial-gradient(ellipse at top, var(--glow) 0%, var(--bg) 60%);
  background-attachment: fixed;
}
#app { max-width: 980px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
.loading { text-align: center; padding: 40vh 0; color: var(--muted); }
h1, h2, h3 { font-family: var(--serif); font-weight: 800; line-height: 1.15; margin: .6em 0 .4em; }
h3 { font-weight: 600; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
a { color: var(--brass2); }
p { margin: .45em 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.tiny { font-size: .78rem; overflow-wrap: anywhere; }
.center { text-align: center; }
.error { color: var(--bad); font-weight: 600; }
.warn { background: var(--accent-soft); border: 1px solid var(--brass); border-radius: 10px; padding: 8px 10px; font-size: .9rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card2); color: var(--text); font: 600 15px var(--sans); text-decoration: none; cursor: pointer;
  transition: transform .06s, background .15s;
}
.btn:hover { background: color-mix(in srgb, var(--text) 8%, var(--card2)); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.btn.primary:hover { background: var(--brass2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--card)); background: var(--bad-soft); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.lg { min-height: 52px; font-size: 17px; padding: 0 20px; }
.btn.xl { min-height: 60px; font-size: 19px; border-radius: 16px; }
.btn.block { display: flex; width: 100%; margin: 14px 0; }
.icon-btn {
  min-width: 44px; min-height: 44px; border-radius: 12px; border: 1px solid transparent; background: transparent;
  color: var(--text); font-size: 20px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
.icon-btn:hover { background: var(--card2); }
.icon-btn.sm { min-width: 36px; min-height: 36px; font-size: 16px; }
.link { background: none; border: 0; color: var(--brass2); text-decoration: underline; cursor: pointer; font: inherit; padding: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.row.end { justify-content: flex-end; margin-top: 18px; }
.row.between { justify-content: space-between; }
.center-row { justify-content: center; margin-top: 18px; }
.btn-col { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* layout */
.topbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; }
.topbar .brand { margin-right: auto; }
/* main navigation (every page) */
.site-nav { display: flex; gap: 2px; }
.site-nav a { padding: 8px 7px; border-radius: 10px; color: var(--muted); text-decoration: none; font: 600 .9rem var(--sans); white-space: nowrap; }
.site-nav a:hover { color: var(--text); background: var(--card2); }
.site-nav a[aria-current="page"] { color: var(--brass2); background: var(--accent-soft); }
.site-nav .ns { display: none; }
@media (max-width: 760px) {
  .site-nav { order: 3; width: 100%; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
  .site-nav a { text-align: center; padding: 8px 2px; font-size: .86rem; }
  .site-nav .nl { display: none; } .site-nav .ns { display: inline; }
}
@media print { .site-nav { display: none !important; } }
/* home page: small link to the solo quiz games */
.challenge-cta { display: flex; align-items: center; gap: 14px; margin: 22px 0 6px; padding: 12px 16px; border-radius: 16px; text-decoration: none; color: var(--text);
  border: 1px solid var(--line); background: linear-gradient(120deg, color-mix(in srgb, #e8a24a 16%, var(--card)), var(--card) 65%); transition: border-color .15s, transform .1s; }
.challenge-cta:hover { border-color: var(--brass); transform: translateY(-1px); }
.cc-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--brass); color: var(--ink); }
.cc-ic .ic { width: 26px; height: 26px; }
.cc-text { flex: 1; min-width: 0; }
.cc-text b { display: block; font: 800 1.05rem var(--serif); }
.cc-text span { display: block; color: var(--muted); font-size: .9rem; }
.cc-go { flex: none; font-weight: 700; color: var(--brass2); }
@media (max-width: 480px) { .cc-go { display: none; } }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 800 1.3rem var(--serif); }
.site-logo { width: 44px; height: 44px; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.35)); }
.logo {
  width: 36px; height: 36px; border-radius: 50%; background: var(--brass); color: var(--ink);
  display: grid; place-items: center; font: bold 22px var(--serif);
}
.page-title { font-size: 1.7rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 40px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.section { margin-top: 26px; }
.hero { padding: 18px 0 8px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 28px; align-items: center; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; gap: 8px; } }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); margin: .2em 0; color: var(--brass2); letter-spacing: -.01em; }
.hero p { color: var(--muted); max-width: 46ch; font-size: 1.05rem; }
.hero .row { margin-top: 16px; }
.empty { text-align: center; padding: 28px 16px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty .big { font: bold 1.2rem var(--serif); color: var(--text); }
.quiz-list { display: grid; gap: 10px; }
.quiz-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none;
}
.quiz-card:hover { border-color: var(--brass); }
.qc-main { flex: 1; min-width: 0; }
.qc-name { font: bold 1.1rem var(--serif); }
.qc-meta { color: var(--muted); font-size: .9rem; }
.chev { font-size: 26px; color: var(--muted); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; white-space: nowrap; }
.pill.live { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.help { margin-top: 26px; color: var(--muted); }
.help summary { cursor: pointer; color: var(--text); font-weight: 600; padding: 8px 0; }
.help li { margin: 6px 0; }

/* forms */
.form h2 { color: var(--brass2); margin-top: 1.2em; }
.form h2:first-child { margin-top: .2em; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.lbl { font-weight: 600; font-size: .95rem; }
.hint { color: var(--muted); font-size: .85rem; }
input, select, textarea {
  font: 16px var(--sans); color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; min-height: 46px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brass); outline-offset: 1px; }
input.sm, select.sm { min-height: 38px; padding: 6px 10px; font-size: 15px; width: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .field { margin: 6px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 1px 0 0; accent-color: var(--brass); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg2);
  font-size: .9rem; user-select: none;
}
.chip small { color: var(--muted); }
.chip input:checked + span { background: var(--brass); color: var(--ink); border-color: var(--brass); }
.chip input:checked + span small { color: var(--ink); opacity: .7; }
.chip input:focus-visible + span { outline: 2px solid var(--brass2); outline-offset: 2px; }

/* quiz page */
.quiz-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.editable { border-bottom: 1px dashed transparent; outline: none; }
.editable:hover, .editable:focus { border-bottom-color: var(--brass); }
.qr-card { display: grid; grid-template-columns: minmax(180px, 280px) 1fr; gap: 20px; align-items: start; }
.qr-wrap { background: #fff; border-radius: 12px; padding: 10px; }
.qr-img { width: 100%; height: auto; display: block; image-rendering: pixelated; border-radius: 6px; }
.rounds { display: grid; gap: 4px; }
.round { padding: 0; }
.round summary { display: flex; gap: 10px; align-items: center; padding: 14px 16px; cursor: pointer; list-style: none; }
.round summary::-webkit-details-marker { display: none; }
.round summary::before { content: '▸'; color: var(--brass); transition: transform .15s; }
.round[open] summary::before { transform: rotate(90deg); }
.rnum { font-weight: 700; color: var(--brass2); white-space: nowrap; }
.rtitle { flex: 1; font-family: var(--serif); font-size: 1.05rem; }
.round-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; }
.round-tools input { flex: 1; min-width: 140px; }
.qlist { margin: 0; padding: 0 16px 12px 40px; }
.q { padding: 10px 0; border-top: 1px solid var(--line); }
.q-text { font-weight: 600; }
.q-ans { color: var(--ok); margin-top: 2px; }
.q-ans .muted { color: var(--muted); font-size: .88rem; }
.q-meta { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.tag { font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: var(--bg2); color: var(--muted); }
.tag.d1, .tag.d2 { color: var(--ok); } .tag.d3 { color: var(--brass); } .tag.d4, .tag.d5 { color: var(--bad); }
.q-tools { margin-left: auto; display: flex; gap: 2px; }
.danger-zone { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }

/* modal + toast */
.modal-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; width: min(520px, 100%); max-height: 88vh; overflow: auto; }
.modal h2 { margin-top: 0; }
.modal-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.modal .form .field { margin: 8px 0; }
.modal .form input + input { margin-top: 6px; }
#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); opacity: 0;
  background: var(--text); color: var(--bg); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px;
  transition: .2s; z-index: 60; max-width: calc(100% - 32px); pointer-events: none;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.banner { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); border: 1px solid var(--brass); padding: 10px 14px; border-radius: 12px; margin: 10px 0; font-size: .95rem; }
.banner.err { background: var(--bad-soft); border-color: var(--bad); margin: 10px 16px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--brass); border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #777; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.dot.off { background: var(--muted); }

/* host */
.host-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 6px; padding: 8px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.hb-title { flex: 1; min-width: 0; }
.hb-name { font: bold 1.05rem var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb-sub { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.host-body { padding-top: 10px; }
.lobby-grid { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 20px; align-items: start; }
.qr-live { background: #fff; color: #222; }
.qr-live .muted { color: #666; }
.team-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.team {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: 600 15px var(--sans); cursor: pointer; max-width: 100%;
}
.team .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 15ch; }
.team.offline { opacity: .6; }
.team.answered { background: var(--ok-soft); border-color: var(--ok); }
.team .tick { color: var(--ok); }
.settings h3 { margin-top: 0; }
.segs { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; margin: 10px 0; }
.seg { flex: 1; min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: var(--text); font: 600 15px var(--sans); cursor: pointer; padding: 6px 10px; }
.seg.on { background: var(--brass); color: var(--ink); }
.q-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; flex-wrap: wrap; }
.q-round { font-family: var(--serif); font-size: 1.05rem; flex: 1; }
.q-count { color: var(--muted); font-weight: 600; }
.host-q .big-q { font: bold clamp(1.35rem, 4.6vw, 2.1rem)/1.25 var(--serif); }
.host-opts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.host-opts li { padding: 10px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); display: flex; gap: 8px; }
.host-opts li b { color: var(--brass2); }
.host-opts li.correct { border-color: var(--ok); background: var(--ok-soft); }
.host-opts li.correct::after { content: '✓'; color: var(--ok); margin-left: 4px; }
.host-opts .count { margin-left: auto; color: var(--muted); font-weight: 700; }
.host-typed { margin-top: 12px; color: var(--ok); }
.answered { text-align: center; font-size: 1.1rem; margin: 8px 0; }
.answered b { color: var(--brass2); font-size: 1.4rem; }
.controls { display: flex; gap: 10px; margin: 16px 0; position: sticky; bottom: calc(10px + env(safe-area-inset-bottom)); }
.controls .btn { flex: 1; box-shadow: 0 6px 18px rgba(0,0,0,.35); white-space: nowrap; padding: 0 10px; }
.team-grid.compact { gap: 6px; }
.team-grid.compact .team { padding: 6px 9px; font-size: 13px; border-radius: 9px; }
.controls .btn.primary { flex: 1.6; }
/* a solid bar stuck to the bottom of the screen: whatever scrolls behind it is hidden, never shown through the gaps */
.dock { position: sticky; bottom: 0; z-index: 5; margin: 12px -16px 0; padding: 8px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); box-shadow: 0 -10px 18px -12px rgba(0,0,0,.6); }
.dock .controls { position: static; margin: 0; }
.dock .controls .btn, .controls.dock .btn { box-shadow: none; }
.dock .answered { margin: 0 0 8px; font-size: 1rem; }
.dock .answered b { font-size: 1.25rem; }
.locked { flex: 1; display: grid; place-items: center; color: var(--muted); font-weight: 600; }
.paused { text-align: center; font: bold 1.4rem var(--serif); color: var(--brass2); }
.timer { position: relative; height: 30px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); overflow: hidden; margin: 8px 0; }
.timer-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, var(--brass), var(--brass2)); transition: width .2s linear; }
.timer.low .timer-fill { background: var(--bad); }
.timer-num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; color: var(--ink); text-shadow: 0 0 6px rgba(255,255,255,.4); }
.board { width: 100%; border-collapse: collapse; }
.board th, .board td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.board th { color: var(--muted); font-size: .85rem; font-weight: 600; }
.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.board tr.first td { color: var(--brass2); font-weight: 700; }
.board.full tbody tr { cursor: pointer; }
.board.full tbody tr:hover { background: var(--card2); }
.board tr.me td { background: var(--accent-soft); font-weight: 700; color: var(--brass2); }
.released { border-color: var(--ok); display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.mark-q .ok-ans { color: var(--ok); margin: 4px 0 8px; }
.mark-q:not(.typed) { opacity: .85; }
.mark-list { list-style: none; padding: 0; margin: 0; }
.mark-list li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.mark-list .tname { font-weight: 600; min-width: 30%; }
.mark-list .given { flex: 1; word-break: break-word; }
.mark { width: 44px; height: 40px; border-radius: 10px; border: 1px solid var(--line); font-size: 18px; font-weight: 800; cursor: pointer; flex: none; }
.mark.yes { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }
.mark.no { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.sheet h3 { color: var(--brass2); }

/* player */
.is-player #app { max-width: 560px; }
.p-bar { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.p-quiz { font: bold 1.05rem var(--serif); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-team { background: var(--brass); color: var(--ink); padding: 4px 10px; border-radius: 99px; font-weight: 700; font-size: .85rem; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn { display: inline-grid; place-items: center; width: 24px; height: 24px; }
.p-main { padding-top: 6px; }
.emoji { font-size: 52px; text-align: center; }
.join, .wait { text-align: center; padding: 24px 18px; }
.join .field { text-align: left; }
.join input { font-size: 20px; min-height: 56px; text-align: center; }
.big { font-size: 1.25rem; }
.qcard .card { padding: 18px; }
.p-q { font: bold clamp(1.25rem, 5.4vw, 1.7rem)/1.3 var(--serif); margin-bottom: 14px; }
.p-q.listen { color: var(--muted); font-size: 1.15rem; text-align: center; }
.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; text-align: left;
  border-radius: 14px; border: 2px solid var(--line); background: var(--bg2); color: var(--text); font: 600 17px var(--sans); cursor: pointer;
}
.opt .letter { width: 36px; height: 36px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; flex: none; color: var(--brass2); font-weight: 800; }
.opt.chosen { border-color: var(--brass); background: var(--accent-soft); }
.opt.chosen .letter { background: var(--brass); color: var(--ink); }
.opt.pending { opacity: .75; }
.opt:disabled { cursor: default; }
.opt:disabled:not(.chosen) { opacity: .5; }
.typed { display: grid; gap: 10px; }
.typed input { font-size: 20px; min-height: 58px; }
.your { color: var(--brass2); margin: 0; }
.note { text-align: center; color: var(--muted); font-weight: 600; margin: 12px 0; }
.note.ok { color: var(--ok); }
.note.locked { color: var(--brass2); }
.small-timer { max-width: 280px; margin: 12px auto; }
.res-top h2 { font-size: 2rem; color: var(--brass2); margin: .2em 0; }
.sheet-list { padding-left: 22px; }
.sheet-list li { margin: 8px 0; }
.sheet-list li.ok { color: var(--ok); }
.sheet-list li.bad b { color: var(--bad); }
details.card summary { cursor: pointer; font-weight: 700; }

@media (max-width: 700px) {
  .qr-card, .lobby-grid { grid-template-columns: 1fr; }
  .qr-wrap { max-width: 280px; margin: 0 auto; }
  .lobby-grid .qr-live { max-width: 360px; margin: 0 auto; width: 100%; }
  .rcol { display: none; }
  .qlist { padding-left: 32px; }
  .host-btn { width: 100%; }
}
@media (max-width: 380px) { .grid2 { grid-template-columns: 1fr; } }
@media print { body { background: #fff; } }

/* branding */
.brand-logo { display: block; max-width: 100%; object-fit: contain; }
.p-logo { height: 34px; width: auto; max-width: 90px; border-radius: 6px; flex: none; }
.join-logo { max-height: 110px; max-width: 70%; margin: 0 auto 8px; border-radius: 10px; }
.p-heading { font: bold 1.6rem var(--serif); color: var(--brass2); letter-spacing: .04em; margin: .2em 0 0; }
.p-tagline { color: var(--brass); font-weight: 700; text-transform: uppercase; font-size: .85rem; letter-spacing: .12em; }
.hb-logo { height: 32px; width: auto; max-width: 70px; border-radius: 6px; object-fit: contain; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 8px 0; }
.swatch { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg2); color: var(--text); cursor: pointer; font: 600 13px var(--sans); text-align: left; }
.swatch.on { border-color: var(--brass); box-shadow: 0 0 0 2px var(--accent-soft); }
.swatch .sw { width: 34px; height: 34px; border-radius: 9px; flex: none; position: relative; overflow: hidden; border: 1px solid rgba(127,127,127,.4); }
.swatch .sw i { position: absolute; right: 0; bottom: 0; width: 55%; height: 55%; border-top-left-radius: 9px; }
.logo-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.logo-box { width: 110px; height: 80px; border-radius: 12px; border: 1px dashed var(--line); display: grid; place-items: center; background: #fff; overflow: hidden; color: #5c5c5c; font-size: .8rem; }
.logo-box img { max-width: 100%; max-height: 100%; }
.print-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 8px; }
.print-item { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.print-item b { font-family: var(--serif); font-size: 1.05rem; }
.print-item .btn { margin-top: auto; }

/* home-page information (also what search engines read) */
.about { display: none; max-width: 980px; margin: 0 auto; padding: 8px 16px calc(40px + env(safe-area-inset-bottom)); }
.route-home .about { display: block; }
.route-home #app .foot { display: none; }
.about h2 { font-size: 1.5rem; color: var(--brass2); margin-top: 1.6em; border-top: 1px solid var(--line); padding-top: 1.2em; }
.about .lead { color: var(--muted); font-size: 1.05rem; max-width: 70ch; }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
.about-grid article { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.about-grid h3 { margin: 0 0 .3em; color: var(--text); }
.about-grid p { color: var(--muted); margin: 0; }
.about-grid.four { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.steps { padding-left: 22px; max-width: 70ch; }
.steps li { margin: 8px 0; color: var(--muted); }
.steps strong { color: var(--text); }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin: 8px 0; }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.faq p { color: var(--muted); margin: 0 0 12px; }
.about-foot { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 30px; }
.loading-inline { color: var(--muted); }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--brass); color: var(--ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.legal { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
.legal h1 { color: var(--brass2); }
.legal h2 { margin-top: 1.4em; }
.legal p, .legal li { color: var(--muted); }
.about .more { color: var(--muted); }
.about a, .legal a:not(.btn):not(.brand) { color: var(--brass2); }
.cats { columns: 3 210px; column-gap: 24px; padding-left: 20px; margin: 12px 0; color: var(--muted); }
.cats li { margin: 3px 0; break-inside: avoid; }

/* guide and sample-questions pages */
.article { max-width: 800px; }
.article .lead { font-size: 1.08rem; }
.article li { margin: 6px 0; }
.article strong { color: var(--text); }
.crumbs { font-size: .85rem; color: var(--muted); margin: 4px 0 -4px; }
.crumbs a { color: var(--muted) !important; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px 10px; margin: 18px 0; }
.toc h2 { font-size: 1.05rem; margin: .8em 0 .2em; }
.toc ol { columns: 2 220px; column-gap: 24px; padding-left: 20px; margin: 6px 0; }
.toc li { margin: 4px 0; break-inside: avoid; }
.cta { background: var(--accent-soft); border: 1px solid var(--brass); border-radius: var(--radius); padding: 6px 18px 18px; margin: 22px 0; }
.cta h2 { margin-top: .8em; }
.cta .btn { margin-top: 6px; }
.legal .cta p, .legal .cta li { color: var(--text); }
.pq-round ol { padding-left: 26px; }
.pq-round li { margin: 0 0 12px; }
.legal .pq-q { color: var(--text); margin: 0 0 4px; }
.pq-round details summary { cursor: pointer; color: var(--brass2); font-size: .9rem; width: max-content; }
.legal .pq-a { color: var(--ok); font-weight: 700; margin: 4px 0 0; }
.pq-fig { margin: 6px 0 8px; max-width: 440px; }
.pq-fig img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; border-radius: 10px; background: #0d1712; }
.pq-fig figcaption { font-size: .72rem; color: var(--muted); margin-top: 3px; }

.keep-on { background: var(--accent-soft); border: 1px solid var(--brass); border-radius: 12px; padding: 10px 14px; margin: 10px 0; font-size: .92rem; }
.keep-on p { margin: 0 0 6px; }
.keep-on ul { margin: 0; padding-left: 20px; }
.keep-on li { margin: 4px 0; }

/* teams with several phones */
.team-box { background: var(--accent-soft); border: 1px solid var(--brass); border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.team-code { font: 800 2.4rem/1.1 var(--sans); letter-spacing: .25em; color: var(--brass2); margin: 2px 0 4px; padding-left: .25em; }
.member-chips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.member-chips li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: .9rem; }
.team-pick { display: grid; gap: 8px; margin: 8px 0 4px; text-align: left; }
.pick { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg2); color: var(--text); font: 600 16px var(--sans); cursor: pointer; text-align: left; }
.pick small { color: var(--muted); font-weight: 600; white-space: nowrap; }
.pick.on { border-color: var(--brass); background: var(--accent-soft); }
.pick:disabled { opacity: .45; cursor: not-allowed; }
.join h3 { margin: 14px 0 4px; }
input[aria-invalid="true"] { border-color: var(--bad); outline-color: var(--bad); }
.opt { position: relative; }
.by-tag { margin-left: auto; font-size: .78rem; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--brass); color: var(--ink); white-space: nowrap; max-width: 40%; overflow: hidden; text-overflow: ellipsis; }
.by { color: var(--muted); font-weight: 600; }
.p-team small { font-weight: 600; opacity: .8; }
.team .phones { font-size: .8rem; color: var(--muted); }
.code { letter-spacing: .15em; color: var(--brass2); font-size: 1.1rem; }
.member-list { list-style: none; padding: 0; margin: 8px 0; }
.member-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.member-list .mname { flex: 1; }
.stars { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.stars h3 { margin: 0 0 4px; color: var(--brass2); }
.star-list { margin: 6px 0 0; padding-left: 22px; }
.star-list li { margin: 4px 0; }

.close-tag { display: inline-block; margin-left: 6px; font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--brass2); border: 1px solid var(--brass); }
.mark-list li.close { background: color-mix(in srgb, var(--brass) 8%, transparent); }

.thanks { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 10px 0; border-radius: 14px; background: var(--accent-soft); border: 1px solid var(--brass); }
.thanks b { font: bold 1.1rem var(--serif); color: var(--brass2); }
.thanks-logo { max-height: 40px; max-width: 80px; border-radius: 6px; flex: none; }
.look h3:first-of-type { margin-top: .6em; }
.look-note { margin: 4px 0 12px; }


/* ---------------------------------------------------------------- v2 look */
.ic { display: inline-flex; width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.ic svg { width: 100%; height: 100%; }
.ic.gold { color: #f2c14e; } .ic.silver { color: #c9d1d9; } .ic.bronze { color: #d4945a; }
.big-ic { width: 56px; height: 56px; color: var(--brass2); margin: 4px auto; display: flex; }
.huge-ic { width: 96px; height: 96px; color: var(--brass2); margin: 0 auto 10px; display: flex; }
.hero-points { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .92rem; margin-top: 14px !important; }
.hero-points .ic { color: var(--ok); }

/* hero picture: phone + QR card, drawn in HTML so it is sharp and light */
.hero-mock { position: relative; height: 330px; max-width: 380px; width: 100%; justify-self: center; }
@media (max-width: 760px) { .hero-mock { height: 290px; max-width: 340px; transform: scale(.85); transform-origin: top center; margin: 6px auto 0; } }
.mock-phone { position: absolute; right: 8px; top: 0; width: 220px; height: 320px; border-radius: 30px; padding: 16px 12px;
  background: #0f1a14; border: 3px solid #3a5a4c; box-shadow: 0 20px 50px rgba(0,0,0,.45); transform: rotate(3deg); display: flex; flex-direction: column; gap: 8px; }
.mock-top { display: flex; justify-content: space-between; align-items: center; }
.mock-pill { font-size: 10px; padding: 3px 8px; border-radius: 99px; background: var(--card2); color: var(--muted); }
.mock-ring { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--brass); display: grid; place-items: center; font: 700 11px var(--sans); color: var(--brass2); }
.mock-q { font: 700 15px/1.25 var(--serif); color: var(--text); }
.mock-opts { display: grid; gap: 6px; }
.mock-opt { display: flex; gap: 8px; align-items: center; font-size: 12px; padding: 7px 8px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); }
.mock-opt b { width: 18px; height: 18px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-size: 10px; flex: none; }
.mock-opt.on { background: var(--accent-soft); border-color: var(--brass); }
.mock-opt.on b { background: var(--brass); color: var(--ink); }
.mock-ok { font-size: 11px; color: var(--ok); margin-top: auto; }
.mock-card { position: absolute; left: 0; top: 70px; width: 150px; padding: 12px 12px 8px; border-radius: 16px; background: #fffaf0; color: #16261e;
  box-shadow: 0 16px 40px rgba(0,0,0,.4); transform: rotate(-5deg); text-align: center; }
.mock-qr-code { color: #111; } .mock-qr-code svg { width: 100%; height: auto; display: block; }
.mock-scan { font: 800 13px var(--serif); margin-top: 6px; }

/* how it works (no quizzes yet) */
.how-strip { margin: 22px 0 8px; padding: 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.how-strip ol { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.how-strip li { display: grid; gap: 4px; }
.how-strip li span:not(.hiw-ic) { color: var(--muted); font-size: .92rem; }
.hiw-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--brass2); display: grid; place-items: center; }
.hiw-ic .ic { width: 22px; height: 22px; }

/* "Your look", folded */
.look-fold > summary { list-style: none; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.look-fold > summary::-webkit-details-marker { display: none; }
.look-fold > summary .sw { width: 34px; height: 34px; border-radius: 9px; position: relative; border: 1px solid var(--line); flex: none; }
.look-fold > summary .sw i { position: absolute; right: 5px; bottom: 5px; width: 12px; height: 12px; border-radius: 50%; }
.look-ic { width: 26px; height: 26px; color: var(--brass2); }
.look-sum { flex: 1; min-width: 0; display: grid; }
.look-sum small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.look-fold[open] > summary .btn { display: none; }
.look-fold[open] > summary { margin-bottom: 8px; }
.look-fold > .look { border: 0; padding: 0; margin: 0; background: none; }

/* grouped categories */
.cat-group { margin: 10px 0 4px; }
.cat-group-h { font: 600 .82rem var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 4px; }

/* ring countdown */
.ring-timer { position: relative; width: 56px; height: 56px; margin: 6px auto; }
.ring-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--card2); stroke-width: 4.5; }
.ring-fg { fill: none; stroke: var(--brass); stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 100; transition: stroke-dashoffset .2s linear; }
.ring-timer .timer-num { position: absolute; inset: 0; display: grid; place-items: center; font: 800 1.15rem var(--sans); }
.ring-timer.low .ring-fg { stroke: var(--bad); }
.ring-timer.low .timer-num { color: var(--bad); }

/* question pictures and formats */
.q-flag { display: block; width: min(240px, 70%); aspect-ratio: 4 / 3; object-fit: cover; margin: 0 auto 12px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 6px 18px rgba(0,0,0,.35); background: #fff; }
.host-flag { width: min(200px, 50%); }
.mini-flag { width: 48px; margin: 0 0 4px; border-radius: 4px; }
.emoji-q { font-size: 2.6rem; line-height: 1.3; margin-top: 6px; letter-spacing: .08em; }
.opts.tf { grid-template-columns: 1fr 1fr; }
.opts.tf .opt { justify-content: center; font-size: 1.15rem; }
.opts.tf .letter { display: none; }
.q-note { font-size: .9rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 10px; }
.guess-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.guess-list li { display: flex; justify-content: space-between; padding: 6px 10px; border-radius: 8px; background: var(--card2); font-size: .95rem; }
.guess-list li.win { background: var(--ok-soft); outline: 1px solid var(--ok); }
.tiebreak { border-color: var(--brass); }
.tiebreak h3 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.screen-btn { margin: 4px 0 10px; }
.small-qr { width: 220px; height: auto; display: block; margin: 10px auto; background: #fff; padding: 8px; border-radius: 10px; }

/* "answer in" */
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }
@keyframes glow { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.opt.pop { animation: pop .35s ease-out, glow .7s ease-out; }
.note.ok.pop, .your.pop { animation: pop .35s ease-out; }
.note .ic { color: inherit; }

/* podium */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin: 18px 0 8px; }
.pod { flex: 1; max-width: 140px; text-align: center; display: flex; flex-direction: column; justify-content: flex-end; }
.pod-names { font: 700 .95rem/1.2 var(--serif); margin-bottom: 4px; overflow-wrap: anywhere; }
.pod-score { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.pod-step { border-radius: 10px 10px 0 0; font: 800 1.6rem var(--serif); display: grid; place-items: center; color: var(--ink); }
.pod.p1 .pod-step { height: 96px; background: linear-gradient(#f6d77a, #e2ac38); }
.pod.p2 .pod-step { height: 70px; background: linear-gradient(#e7ebef, #aeb8c2); }
.pod.p3 .pod-step { height: 52px; background: linear-gradient(#e8b98d, #c27c43); }
.pod.me .pod-names { color: var(--brass2); }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; }
.thanks-ic { width: 40px; height: 40px; color: var(--brass2); }

/* ---------------------------------------------------------------- big screen (pub TV) */
.is-screen #app { max-width: none; padding: 0; }
.bigscreen { min-height: 100vh; display: flex; flex-direction: column; font-size: clamp(16px, 1.6vw, 34px); }
.bs-bar { display: flex; align-items: center; gap: 1em; padding: .8em 1.4em; border-bottom: 1px solid var(--line); }
.bs-logo { height: 2.6em; width: auto; }
.bs-title { flex: 1; }
.bs-tag { color: var(--brass); font: 700 .7em var(--sans); letter-spacing: .12em; }
.bs-head { font: 800 1.6em/1 var(--serif); color: var(--brass2); }
.bs-quiz { text-align: right; font: 600 1em var(--serif); }
.bs-quiz small { display: block; color: var(--muted); font: .7em var(--sans); }
.bs-body { flex: 1; padding: 1.2em 2em; display: flex; flex-direction: column; }
.bs-body.center { align-items: center; justify-content: center; text-align: center; }
.bs-wait h1 { font-size: 2.2em; margin: .2em 0; }
.bs-lobby { flex-direction: row; gap: 2em; align-items: center; justify-content: center; }
.bs-join { text-align: center; }
.bs-qr { width: min(42vh, 36vw); height: auto; background: #fff; padding: 1em; border-radius: 1em; }
.bs-join h1 { font-size: 2em; margin: .5em 0 .2em; }
.bs-teams { min-width: 30%; max-width: 40%; }
.bs-teams ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4em; }
.bs-teams li { padding: .3em .7em; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); font-size: .9em; }
.bs-qhead { display: flex; gap: 1em; align-items: center; font-size: .9em; color: var(--muted); }
.bs-qno { margin-left: auto; }
.bs-qwrap { flex: 1; display: grid; grid-template-columns: 1fr auto; gap: 2em; align-items: center; }
.bs-q { font: 800 2.4em/1.15 var(--serif); margin: .4em 0 .6em; }
.bs-q .emoji-q { font-size: 1.5em; }
.bs-flag { width: min(36vw, 46vh); margin: 0 0 .5em; }
/* picture questions */
.q-figure { margin: 0 auto 12px; text-align: center; }
.q-pic { display: block; margin: 0 auto; max-width: 100%; max-height: 42vh; width: auto; height: auto; object-fit: contain; border-radius: 10px; background: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 6px 18px rgba(0,0,0,.35); }
.host-pic { max-height: 34vh; }
.bs-figure { margin: 0 0 .5em; text-align: left; }
.bs-pic { margin: 0; max-height: 52vh; max-width: 62vw; }
.mini-pic, .list-pic { display: block; max-height: 72px; max-width: 120px; margin: 0 0 4px; border-radius: 6px; box-shadow: none; }
.pic-credit { font-size: .68rem; opacity: .65; margin-top: 4px; line-height: 1.25; overflow-wrap: anywhere; }
.bs-figure .pic-credit { font-size: .8rem; }
.pic-field .pic-count { margin-top: 8px; }
.pic-field .pic-count select:disabled { opacity: .5; }
.chip-pics { margin-left: 6px; opacity: .8; white-space: nowrap; }
.chip span.ic { display: inline-flex; padding: 0; border: 0; border-radius: 0; background: none; font-size: inherit; }
.chip-pics .ic { width: .95em; height: .95em; vertical-align: -2px; margin-right: 2px; }
/* big screen: a picture question puts the picture beside the question and answers */
.bs-main.has-pic { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 1.6em; align-items: center; }
.bs-main.has-pic .bs-figure { margin: 0; }
.bs-main.has-pic .bs-pic { max-width: 100%; max-height: 64vh; }
.bs-main.has-pic .bs-q { font-size: 2em; margin-top: 0; }
.bs-main.has-pic .bs-opts { grid-template-columns: 1fr; }
@media (max-width: 700px) { .bs-main.has-pic { display: block; } }

.bs-opts { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6em; }
.bs-opts.tf { grid-template-columns: 1fr 1fr; }
.bs-opts li { display: flex; gap: .7em; align-items: center; padding: .6em .9em; border-radius: .7em; background: var(--card); border: 2px solid var(--line); font-size: 1.15em; }
.bs-opts li b { width: 1.8em; height: 1.8em; border-radius: 50%; display: grid; place-items: center; background: var(--brass); color: var(--ink); flex: none; }
.bs-opts li.right { border-color: var(--ok); background: var(--ok-soft); }
.bs-hint, .bs-reveal { font-size: 1.1em; color: var(--muted); }
.bs-reveal b { color: var(--ok); }
.bs-side { text-align: center; min-width: 9em; }
.bs-ring { width: 7em; height: 7em; }
.bs-ring .timer-num { font-size: 2.2em; }
.bs-count b { display: block; font: 800 3em/1 var(--serif); color: var(--brass2); }
.bs-count span { color: var(--muted); }
.bs-locked { margin-top: .8em; color: var(--bad); font-weight: 700; }
.bs-board { list-style: none; padding: 0; margin: 1em auto; min-width: 50%; text-align: left; }
.bs-board li { display: grid; grid-template-columns: 2em 1fr auto; gap: .6em; padding: .3em .6em; border-bottom: 1px solid var(--line); }
.bs-win { font-size: 2.4em; }
.bs-podium { width: min(900px, 90%); }
.bs-podium .pod { flex: 1 1 0; max-width: 32%; }
.bs-podium .pod-names { font-size: 1.3em; }
.bs-podium .pod-step { font-size: 1.6em; }
.bs-podium .p1 .pod-step { height: 9em; } .bs-podium .p2 .pod-step { height: 6.5em; } .bs-podium .p3 .pod-step { height: 4.8em; }
@media (max-width: 700px) { .bs-lobby, .bs-qwrap { display: flex; flex-direction: column; } .bs-teams { max-width: none; } }

@media (prefers-reduced-motion: reduce) { .opt.pop, .note.ok.pop, .your.pop { animation: none; } .ring-fg { transition: none; } }

/* reading pages */
.page-hero { display: flex; gap: 18px; align-items: center; margin: 8px 0 4px; }
.page-hero img { width: 96px; height: 96px; flex: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.page-hero h1 { margin: .2em 0; }
@media (max-width: 700px) { .page-hero img { display: none; } }
.print-round { margin: -4px 0 8px; }
.print-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
@media (min-width: 1340px) {
  .article .toc { position: fixed; top: 96px; left: calc(50% - 400px - 250px); width: 230px; max-height: calc(100vh - 120px); overflow: auto; margin: 0; }
  .article .toc ol { columns: 1; }
}
@media print {
  :root { --text: #111; --muted: #333; --brass2: #111; }
  body { background: #fff !important; color: #111; }
  .topbar, .crumbs, .cta, .toc, .foot, .print-round, .print-bar, .page-hero img, .skip-link { display: none !important; }
  body.printing .pq-round:not(.to-print), body.printing .article > :not(.pq-round):not(h1):not(.page-hero) { display: none !important; }
  .pq-round { break-inside: auto; }
  .pq-round li { break-inside: avoid; }
  .pq-round details summary { display: none; }
  .legal .pq-q, .legal .pq-a { color: #111; }
  .legal .pq-a::before { content: "Answer: "; font-weight: 400; }
}
.host-list { padding-left: 20px; max-width: 75ch; }
.host-list li { margin: 8px 0; color: var(--muted); }
.host-list strong { color: var(--text); }

.quiz-row { display: flex; align-items: stretch; gap: 6px; }
.quiz-row .quiz-card { flex: 1; min-width: 0; }
.qc-actions { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.qc-actions .icon-btn { border: 1px solid var(--line); background: var(--card); }
.qc-actions .ic { width: 18px; height: 18px; }
.qc-del:hover { color: var(--bad); border-color: var(--bad); }
/* end of a quiz: link to the solo quiz games */
.practice-link { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); text-decoration: none; }
.practice-link > .ic { width: 28px; height: 28px; color: var(--brass2); }
.practice-link > span:nth-child(2) { flex: 1; }
.practice-link b { display: block; }
.practice-link small { display: block; color: var(--muted); }
.practice-link .pl-go { font-size: 1.5rem; color: var(--brass2); }
.bs-practice { color: var(--muted); font-size: 1.1rem; margin-top: 18px; }
.bs-practice b { color: var(--brass2); }
/* navigation inside the reading pages (overrides .legal link colours) */
.legal .site-nav a:not(.btn):not(.brand) { color: var(--muted); text-decoration: none; }
.legal .site-nav a:not(.btn):not(.brand):hover { color: var(--text); }
.legal .site-nav a[aria-current="page"]:not(.btn):not(.brand) { color: var(--brass2); }
.legal .site-nav span { color: inherit; }
/* quiz question pages: answer notes, related links, hub list */
.pq-note { font-size: .9rem; margin-top: 2px; }
.related { margin-top: 26px; }
.related p { line-height: 1.9; }
.hub-group h2 { margin-top: 1.6em; }
.hub-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.hub-list li { margin: 0 !important; }
.legal .hub-list a { display: block; height: 100%; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-decoration: none; transition: border-color .15s, transform .1s; }
.legal .hub-list a:hover { border-color: var(--brass); transform: translateY(-1px); }
.hub-list b { display: block; color: var(--text); font: 800 1.02rem var(--serif); }
.hub-list span { display: block; color: var(--muted); font-size: .86rem; margin-top: 3px; }
/* home: question of the day */
.qotd { margin: 22px 0 6px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, #e8a24a 14%, var(--card)), var(--card) 60%); }
.qotd-head { display: flex; align-items: center; gap: 12px; }
.qotd-head b { display: block; font: 800 1.1rem var(--serif); }
.qotd-head small { color: var(--muted); }
.qotd-cat { margin: 12px 0 0; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--brass2); }
.qotd-q { font: 700 1.15rem/1.3 var(--serif); margin: 4px 0 10px; color: var(--text); }
.qotd-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 560px) { .qotd-opts { grid-template-columns: 1fr; } }
.qotd-opt { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 12px; text-align: left; border-radius: 12px; border: 2px solid var(--line); background: var(--card2); color: var(--text); font: 600 .95rem var(--sans); cursor: pointer; }
.qotd-opt b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--bg2); color: var(--brass2); font-size: .8rem; }
.qotd-opt:hover:not(:disabled) { border-color: var(--brass); }
.qotd-opt:disabled { cursor: default; opacity: .55; }
.qotd-opt.right { opacity: 1; border-color: var(--ok); background: var(--ok-soft); }
.qotd-opt.wrong { opacity: 1; border-color: var(--bad); background: var(--bad-soft); }
.qotd-fb p { color: var(--muted); margin: 10px 0 8px; }
.qotd-fb .ok { color: var(--ok); } .qotd-fb .no { color: var(--bad); }
.qotd-more { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: .92rem; }
.qotd-more > .ic { width: 22px; height: 22px; color: var(--brass2); flex: none; }
.qotd-more > span:nth-child(2) { flex: 1; }
.qotd-more b { color: var(--text); }
.qotd-more:hover b { color: var(--brass2); }
/* stats.php */
.stats-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stats-tiles .card { margin: 0; text-align: center; }
.stats-tiles b { display: block; font: 800 1.8rem var(--serif); color: var(--brass2); }
.stats-tiles span { color: var(--muted); font-size: .85rem; }
.stats-page .board { width: 100%; }

/* report-a-question link on the host screen */
.q-report { display: inline-block; margin-top: 10px; font-size: .82rem; color: var(--muted); }

/* "Why not play a quiz while you wait?" (player phones) */
.wq { margin: 16px 0; }
.wq-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.wq-head > .ic { width: 30px; height: 30px; color: var(--brass2); flex: none; }
.wq-head b { display: block; font: 800 1.05rem var(--serif); }
.wq-head small { color: var(--muted); font-size: .82rem; }
.wq-head > div { flex: 1; }
.wq-score { font: 800 1.1rem var(--sans); color: var(--brass2); }
.wq-fb { margin-top: 10px; }
.wq-fb .ok { color: var(--ok); } .wq-fb .no { color: var(--bad); }
/* back to a bingo game, on the home page */
.bg-back-home { display: flex; align-items: center; gap: 12px; margin: 12px 0; text-decoration: none; color: var(--text); border-color: var(--brass); }
.bg-back-home .ic { width: 28px; height: 28px; color: var(--brass2); }
.bg-back-home span:nth-child(2) { flex: 1; }
.bg-back-home b { display: block; }
.bg-back-home small { color: var(--muted); }

/* partner sites, at the bottom of every page */
.partner-sites { max-width: 620px; margin: 14px auto 10px; padding: 12px 16px; border-top: 1px solid var(--line); text-align: center; }
.partner-sites h3 { margin: 0 0 4px; font: 700 .8rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.partner-sites p { margin: 0; font-size: .88rem; line-height: 1.5; color: var(--muted); }
.play-instead { margin: 14px 0; padding: 10px 14px; border-left: 3px solid var(--brass); background: var(--card); border-radius: 0 10px 10px 0; }

/* ---------------------------------------------------------------- printable quiz page (/printable-quiz/) */
.paper-page #app { max-width: 980px; }
.pp-hero { text-align: center; padding: 28px 8px 10px; }
.pp-hero h1 { font: 800 clamp(2.2rem, 6.5vw, 3.4rem)/1.05 var(--serif); color: var(--brass2); margin: 8px 0 10px; }
.pp-hero .lead { max-width: 660px; margin: 0 auto 10px; font-size: 1.08rem; }
.pp-form .cat-groups { margin-top: 6px; }
.pp-result { margin-bottom: 16px; }
.pp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pp-actions .ic { width: 16px; height: 16px; }
.pp-form-h { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; }
.pp-form-h h2 { margin: .2em 0; }
.pp-limit { padding: 24px 18px; }
.pp-limit h2 { font: 800 1.5rem var(--serif); color: var(--brass2); margin: 0 0 6px; }
.pp-pic { display: block; max-width: min(220px, 100%); max-height: 140px; border-radius: 8px; margin: 6px 0 2px; background: #fff; }
.pp-flag { display: block; height: 42px; margin: 6px 0 2px; border: 1px solid var(--line); border-radius: 3px; }
.pp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pp-head h2 { font: 800 1.7rem/1.1 var(--serif); color: var(--brass2); margin: 0 0 4px; }
.pp-head p { margin: 0; }
.pp-dls { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin: 16px 0 8px; }
.pp-dl { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: var(--card2); border: 1px solid var(--line); color: var(--text); font: inherit; }
.pp-dl:hover { border-color: var(--brass); }
.pp-dl .ic { width: 26px; height: 26px; flex: none; color: var(--brass2); }
.pp-dl span { display: flex; flex-direction: column; gap: 2px; }
.pp-dl b { font-size: 1.02rem; }
.pp-dl small { color: var(--muted); font-size: .82rem; line-height: 1.3; }
.pp-dl.primary { background: var(--brass); border-color: var(--brass); color: var(--ink); }
.pp-dl.primary .ic, .pp-dl.primary small { color: var(--ink); }
.pp-dl.primary small { opacity: .75; }
.pp-dl:disabled { opacity: .6; cursor: progress; }
.pp-toggle { margin: 14px 0 4px; }
.pp-round { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 14px; }
.pp-round-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pp-round-h h3 { font: 800 1.15rem var(--serif); margin: 0; }
.pp-round-h .btn { margin-left: auto; }
.pp-qs { margin: 8px 0 0; padding-left: 1.6em; }
.pp-qs li { padding: 4px 0; }
.pp-qs li::marker { color: var(--brass2); font-weight: 700; }
.pp-row { display: flex; align-items: flex-start; gap: 8px; }
.pp-q { flex: 1; min-width: 0; }
.pp-opts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 3px; font-size: .9rem; color: var(--muted); }
.pp-opts b { color: var(--brass2); }
.pp-a { display: none; margin-top: 3px; font-size: .92rem; color: var(--ok); }
.show-answers .pp-a { display: block; }
.show-answers .pp-opts .right { color: var(--ok); font-weight: 700; }
.pp-about { max-width: 760px; margin: 40px auto 0; padding: 0 4px; }
.pp-about h2 { font: 800 1.6rem var(--serif); color: var(--brass2); }
.pp-about h3 { font: 800 1.15rem var(--serif); margin-top: 1.6em; }
.pp-about ol, .pp-about ul { padding-left: 1.3em; }
.pp-about li { margin: .3em 0; }
.pp-about details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
.pp-about summary { cursor: pointer; font-weight: 700; }
.paper-tip { margin: 0 0 4px; }
.paper-tip .ic { width: 18px; height: 18px; vertical-align: -4px; color: var(--brass2); }

/* ---------------------------------------------------------------- Buy me a coffee (a plain link, no outside script) */
.coffee-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; background: #ffdd00; color: #1b1508 !important;
  font: 700 .92rem var(--sans); text-decoration: none !important; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,.25); vertical-align: middle; }
.coffee-btn:hover { background: #ffe740; }
.coffee-btn .ic { width: 18px; height: 18px; }
.coffee-line { margin: 14px 0 4px; }
.coffee-card { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin: 18px 0 8px;
  padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px dashed var(--line); }
.coffee-card p { margin: 0; flex: 1 1 260px; color: var(--muted); font-size: .92rem; }
@media print { .coffee-line, .coffee-card { display: none !important; } }

/* ---------------------------------------------------------------- visitor numbers page: graphs (plain SVG, no scripts) */
.stats-page { --viz-1: #c98500; --viz-2: #3f8fe0; }   /* checked for colour-blind separation on the card colour */
.viz-card { padding: 14px 16px; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 6px; color: var(--muted); font-size: .9rem; }
.viz-legend b { color: var(--text); }
.viz-legend i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 7px; }
.viz-legend .sw-uv { background: var(--viz-1); } .viz-legend .sw-pv { background: var(--viz-2); }
.viz-line { display: block; overflow: visible; }
.viz-line .grid { stroke: var(--line); stroke-width: 1; }
.viz-line .tick { fill: var(--muted); font: 11px var(--sans); }
.viz-l { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.viz-l.uv, .viz-dot.uv { stroke: var(--viz-1); } .viz-l.pv, .viz-dot.pv { stroke: var(--viz-2); }
.viz-dot.uv { fill: var(--viz-1); } .viz-dot.pv { fill: var(--viz-2); }
.viz-dot { stroke: var(--card) !important; stroke-width: 2; paint-order: stroke; }
.viz-line .hit { fill: transparent; cursor: default; }
.viz-line .hit:hover { fill: rgba(255, 255, 255, .07); }
.viz-table { margin: 8px 0 0; }
.viz-table summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.viz-bars { display: grid; gap: 2px; }
.vb-row { display: grid; grid-template-columns: minmax(90px, 36%) 1fr auto; gap: 10px; align-items: center; padding: 4px 0; font-size: .92rem; }
.vb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb-bar { display: block; }
.vb-bar rect { fill: var(--viz-1); }
.vb-row:hover .vb-bar rect { fill: #e09a10; }
.vb-num { text-align: right; font-variant-numeric: tabular-nums; min-width: 64px; }
.vb-num small { color: var(--muted); }
@media (max-width: 600px) { .vb-row { grid-template-columns: 46% 1fr auto; } .vb-label { white-space: normal; line-height: 1.25; } }
/* Buy me a coffee cup in the top bar */
.coffee-nav { flex: none; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #ffdd00; color: #1b1508;
  text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: transform .15s; }
.coffee-nav:hover { background: #ffe740; transform: rotate(-8deg) scale(1.06); }
.coffee-nav .ic { width: 21px; height: 21px; }
@media print { .coffee-nav { display: none !important; } }
.legal a.coffee-nav, .about a.coffee-nav { color: #1b1508 !important; }
/* when the nav can't sit beside the name, it gets its own row and the cup + settings stay top right */
@media (min-width: 761px) and (max-width: 1010px) { .site-nav { order: 3; width: 100%; } }
@media (min-width: 761px) { .legal .site-nav { order: 3; width: 100%; } }
/* small phones: a smaller logo and name so the cup and settings fit on the same row */
@media (max-width: 430px) { .topbar .brand { font-size: 1.1rem; gap: 8px; } .topbar .brand .site-logo { width: 36px; height: 36px; } }
@media (max-width: 350px) { .topbar { gap: 8px; } .topbar .brand { font-size: .95rem; } .topbar .brand .site-logo { width: 32px; height: 32px; } }

/* =====================================================================================================
   Classroom look: graph-paper background, chalkboard hero, subject cards, age-group picker, custom builder
   ===================================================================================================== */
:root { --maths: #2c5aa0; --science: #2e7d57; --english: #8c2f39; }
body {
  background-color: var(--bg);
  background-image:
    linear-gradient(color-mix(in srgb, var(--line) 38%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 38%, transparent) 1px, transparent 1px),
    radial-gradient(ellipse at top, var(--glow) 0%, var(--bg) 70%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
  background-attachment: fixed;
}
.is-screen body, body.is-screen { background-size: 40px 40px, 40px 40px, 100% 100%; }
:root:not([data-theme]) , [data-theme="parchment"], [data-theme="exercise"], [data-theme="lab"] { --shadow: 0 1px 0 rgba(30, 40, 70, .05), 0 6px 18px -10px rgba(30, 40, 70, .25); }
.card, .how-strip, .qotd, .quiz-card, .subject-card { box-shadow: var(--shadow, none); }
.site-logo { filter: none; }
.brand span { letter-spacing: -.005em; }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--brass); }
@media (max-width: 760px) { .site-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
h2.section { display: flex; align-items: center; gap: 10px; }
h2.section::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.page-title { position: relative; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 70ch; }

/* hero */
.hero-kicker { font: 700 .78rem var(--sans) !important; text-transform: uppercase; letter-spacing: .14em; color: var(--brass) !important; margin: 0 !important; }
.hero h1 { color: var(--text); }
.hero h1::after { content: ''; display: block; width: 84px; height: 5px; margin-top: 12px; border-radius: 3px;
  background: linear-gradient(90deg, var(--maths) 0 33%, var(--science) 33% 66%, var(--english) 66%); }
.hero-import { margin-top: 4px !important; }
.hero-import .link { padding: 4px 0; font-size: .9rem; }
.hero-mock { height: 340px; max-width: 420px; }
.hero-mock .art-board { position: absolute; left: 0; top: 0; width: 330px; max-width: 86%; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .25)); transform: rotate(-2deg); }
.hero-mock .art-board svg { width: 100%; height: auto; display: block; }
.hero-mock .mock-card { top: 176px; left: 6px; width: 128px; transform: rotate(-4deg); z-index: 2; }
.hero-mock .mock-phone { top: 46px; right: 0; width: 200px; height: 292px; z-index: 3; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-mock { height: 300px; max-width: 360px; }
  .hero-mock .art-board { width: 270px; }
  .hero-mock .mock-card { top: 150px; }
  .hero-mock .mock-phone { width: 180px; height: 270px; top: 28px; }
}

/* subject cards */
.subjects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 20px 0 6px; }
.subject-card { display: grid; gap: 4px; align-content: start; padding: 16px 16px 14px; border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--sc, var(--brass)); transition: transform .12s, border-color .15s; }
.subject-card:hover { transform: translateY(-2px); border-color: var(--sc); }
.subject-card .art { width: 96px; height: 72px; margin-bottom: 4px; }
.subject-card .art svg { width: 100%; height: 100%; display: block; }
.subject-card b { font: 800 1.35rem var(--serif); }
.subject-card > span:not(.art) { color: var(--muted); font-size: .92rem; }
.subject-card .subject-go { color: var(--sc) !important; font-weight: 700; margin-top: 6px; }
[data-theme]:not([data-theme="parchment"]):not([data-theme="exercise"]):not([data-theme="lab"]) .subject-card .subject-go { color: var(--brass2) !important; }
.s-maths { --sc: var(--maths); } .s-science { --sc: var(--science); } .s-english { --sc: var(--english); }
.subject-ages { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 2px 0 0; }
.subject-ages span { display: grid; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--card2); border: 1px dashed var(--line); }
.subject-ages b { font: 700 .92rem var(--serif); }
.subject-ages small { color: var(--muted); font-size: .72rem; }
@media (max-width: 760px) {
  .subjects { grid-template-columns: 1fr; }
  .subject-card { grid-template-columns: 76px 1fr; column-gap: 12px; }
  .subject-card .art { grid-row: span 3; width: 76px; height: 58px; }
  .subject-ages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* subject chips on the create / paper forms */
.chip.subject-chip > span { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px; border-radius: 14px; border-left: 5px solid var(--sc); min-width: 200px; }
.chip.subject-chip span.art { display: block; width: 58px; height: 44px; padding: 0; border: 0; background: none; border-radius: 0; flex: none; }
.chip.subject-chip span.art svg { width: 100%; height: 100%; display: block; }
.chip.subject-chip em { font-style: normal; display: grid; line-height: 1.2; }
.chip.subject-chip em b { font: 800 1.15rem var(--serif); }
.chip.subject-chip input:checked + span { border-left-color: var(--sc); }
.chip.subject-chip input:checked + span span.art { background: #fffdf7; border-radius: 8px; }
@media (max-width: 640px) { .chip.subject-chip { flex: 1 1 100%; } }

/* age-group picker */
.age-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 6px 0 4px; }
.age-opt { position: relative; cursor: pointer; }
.age-opt input { position: absolute; opacity: 0; pointer-events: none; }
.age-opt span { display: grid; gap: 2px; text-align: center; padding: 12px 6px; border-radius: 12px; border: 2px solid var(--line); background: var(--card2); height: 100%; }
.age-opt b { font: 800 1.02rem var(--serif); }
.age-opt small { color: var(--muted); font-size: .74rem; }
.age-opt input:checked + span { border-color: var(--brass); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--brass); }
.age-opt input:focus-visible + span { outline: 2px solid var(--brass2); outline-offset: 2px; }
@media (max-width: 640px) { .age-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.board-tip { display: flex; gap: 8px; align-items: flex-start; margin: -4px 0 12px; }
.board-tip .ic, .look-note .ic { flex: none; }

/* custom quiz builder */
.cu-lead { margin-bottom: 4px; }
.cu-round { border-top: 4px solid var(--brass); }
.cu-round-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.cu-round-head .rnum { font: 800 1.05rem var(--serif); color: var(--brass2); }
.cu-title { flex: 1 1 220px; font-weight: 700; }
.cu-qs { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cu-q { padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line);
  background-image: linear-gradient(90deg, transparent 38px, color-mix(in srgb, var(--bad) 45%, transparent) 38px 39.5px, transparent 39.5px); padding-left: 50px; position: relative; }
.cu-q-head { display: flex; align-items: center; justify-content: space-between; margin: -2px 0 2px; }
.cu-num { position: absolute; left: 8px; top: 12px; width: 26px; text-align: center; font: 800 .82rem var(--serif); color: var(--muted); }
.cu-q-tools { margin-left: auto; display: flex; gap: 2px; }
.cu-q .field { margin: 6px 0; }
.cu-ans { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px; }
.cu-right input { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.cu-right .lbl .ic { color: var(--ok); }
.cu-wrong-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cu-wrong .lbl small { font-weight: 400; }
.cu-more summary { cursor: pointer; color: var(--muted); font-size: .86rem; padding: 4px 0; }
.cu-round-foot { margin-top: 10px; }
.cu-actions { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); z-index: 5; }
@media (max-width: 640px) {
  .cu-ans { grid-template-columns: 1fr; }
  .cu-wrong-grid { grid-template-columns: 1fr; }
  .cu-q { padding-left: 12px; background-image: none; padding-top: 34px; }
  .cu-num { top: 10px; left: 12px; text-align: left; }
}
/* paper quiz page */
.pp-hero h1::after { content: ''; display: block; width: 72px; height: 5px; margin-top: 10px; border-radius: 3px;
  background: linear-gradient(90deg, var(--maths) 0 33%, var(--science) 33% 66%, var(--english) 66%); }
.hero-mock .mock-phone { background: var(--card); border: 6px solid #1b2742; box-shadow: 0 18px 40px rgba(20, 30, 60, .35); }
.hero-mock .mock-phone::before { content: ''; display: block; width: 46px; height: 5px; border-radius: 3px; background: #1b2742; opacity: .35; margin: -8px auto 2px; }
.pp-hero h1::after { margin-left: auto; margin-right: auto; }
@media (max-width: 480px) { .topbar .brand { font-size: 1.02rem; gap: 8px; } .topbar .site-logo { width: 36px; height: 36px; } }

/* subject colours for the wider subject list */
:root { --history: #8a5a1f; --geography: #1e7a8c; --biology: #3f8f3f; --chemistry: #7b4aa5; --physics: #d2691e; --computing: #2a6f97; --french: #2b4c9b; --spanish: #b45309; --german: #44403c; --welsh: #b91c1c; --drama: #7c2d92; --design_tech: #0f766e; --music: #a3226b; --art: #c0392b; --religious_studies: #6b5b95; --civics_social: #4a5d23; --economics_business: #b8860b; --health_pe: #d1365a; }
.s-history { --sc: var(--history); } .s-geography { --sc: var(--geography); } .s-biology { --sc: var(--biology); } .s-chemistry { --sc: var(--chemistry); } .s-physics { --sc: var(--physics); } .s-computing { --sc: var(--computing); } .s-french { --sc: var(--french); } .s-spanish { --sc: var(--spanish); } .s-german { --sc: var(--german); } .s-welsh { --sc: var(--welsh); } .s-drama { --sc: var(--drama); } .s-design_tech { --sc: var(--design_tech); } .s-music { --sc: var(--music); } .s-art { --sc: var(--art); } .s-religious_studies { --sc: var(--religious_studies); } .s-civics_social { --sc: var(--civics_social); } .s-economics_business { --sc: var(--economics_business); } .s-health_pe { --sc: var(--health_pe); }
.chip.subject-chip.off { opacity: .45; pointer-events: none; }
.country-field select { max-width: 24rem; }
.cat-group .chips { gap: 8px; }
.subjects .country-field { max-width: 32rem; margin: 0 auto 14px; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.subject-grid .subject-card { padding: 12px 10px 14px; text-align: center; align-items: center; }
.subject-grid .subject-card .art { width: 84px; height: 62px; display: block; margin: 0 auto 4px; }
.subject-grid .subject-card .art svg { width: 100%; height: 100%; }
.subject-grid .subject-card b { display: block; }
.subject-grid .subject-n { font-size: .8rem; color: var(--muted); }
.subject-grid .subject-card.off { opacity: .4; pointer-events: none; }
.subjects { display: block; } .subjects .subject-ages { margin-top: 12px; }

/* Create-a-quiz / paper quiz: subjects are square cards, like on the home page (and stay that way when ticked) */
.cat-group .chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.chip.subject-chip { display: block; min-width: 0; }
.chip.subject-chip > span { flex-direction: column; justify-content: flex-start; align-items: center; text-align: center; gap: 4px;
  height: 100%; min-width: 0; box-sizing: border-box; padding: 12px 8px 12px; border-radius: var(--radius, 14px);
  border: 1px solid var(--line); border-top: 5px solid var(--sc); }
.chip.subject-chip span.art { width: 76px; height: 56px; margin: 0 auto 2px; }
.chip.subject-chip em { justify-items: center; }
.chip.subject-chip em b { font-size: 1.05rem; }
.chip.subject-chip input:checked + span { border-color: var(--sc); border-top-color: var(--sc); box-shadow: 0 0 0 2px var(--sc) inset; }
.chip.subject-chip input:checked + span::after { content: '✓'; position: absolute; top: 9px; right: 9px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font: 800 .8rem/1 system-ui, sans-serif; color: #fff; background: var(--sc); }
@media (max-width: 640px) { .chip.subject-chip { flex: none; } .cat-group .chips { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } }
.subject-btns { margin: 4px 0 2px; }
/* Home page: age groups are links to a quiz from every subject */
.subject-ages-lbl { margin: 14px 0 0; text-align: center; }
.subjects .subject-ages { margin-top: 6px; }
.subject-ages a { display: grid; text-align: center; padding: 8px 4px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.subject-ages a:hover, .subject-ages a:focus-visible { border-color: var(--brass2); transform: translateY(-2px); }
.subject-ages a small { color: var(--muted); font-size: .72rem; }
.quiz-head-btns { align-items: center; justify-content: flex-end; }

/* Subject boxes on phones: the home page cards stay stacked (picture above the name) and long subject names wrap
   inside the box instead of spilling out, even with the phone's text size turned up. */
.subject-grid .subject-card { grid-template-columns: minmax(0, 1fr); min-width: 0; justify-items: center; }
.subject-grid .subject-card .art { grid-row: auto; }
.subject-grid .subject-card b, .subject-grid .subject-n,
.chip.subject-chip em, .chip.subject-chip em b, .chip.subject-chip small {
  max-width: 100%; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.subject-grid .subject-card b { font-size: clamp(1rem, 4.2vw, 1.35rem); line-height: 1.15; }
.chip.subject-chip em b { font-size: clamp(.95rem, 3.9vw, 1.05rem); line-height: 1.15; }
@media (max-width: 400px) {
  .subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cat-group .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .subject-grid .subject-card .art { width: 64px; height: 48px; }
  .chip.subject-chip span.art { width: 60px; height: 44px; }
}

/* Link to the Smart Owl Quiz games */
.owl-promo { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; margin: 22px 0; padding: 14px 18px; border-radius: var(--radius, 14px);
  background: #14284B; color: #fff; text-decoration: none; box-shadow: 0 4px 0 #0b1830; }
.owl-promo img { width: 72px; height: 72px; background: #fff; border-radius: 50%; padding: 4px; }
.owl-promo b { display: block; font: 700 1.15rem var(--serif); color: #fff; }
.owl-promo small { display: block; color: #C9D6EA; font-size: .92rem; margin-top: 2px; }
.owl-promo .owl-go { padding: 10px 16px; border-radius: 99px; background: #C9A227; color: #1d1600; font-weight: 700; white-space: nowrap; }
@media (max-width: 600px) { .owl-promo { grid-template-columns: 56px 1fr; } .owl-promo img { width: 56px; height: 56px; } .owl-promo .owl-go { grid-column: 1 / -1; text-align: center; } }
