/* Quiz section: catalog, quiz page, join, reports and the game stage. Colours of answers and stage
 * themes come from theme.css (.qz-c0..5, .qz-theme-*, .qz-ornament). */
.qz [hidden], .qz-stage [hidden] { display: none !important; }
.qz {
    --qz-ok: #1d8a5c;
    --qz-bad: #c93a52;
    --qz-part: #c9800f;
    --qz-soft: var(--ui-surface-2, #f0f3f7);
    max-width: 1100px;
    margin: 0 auto;
    color: var(--ui-text, #1b2430);
}
.qz-h1 { margin: 0; font-size: 28px; font-weight: 800; line-height: 1.2; }
.qz-h2 { margin: 26px 0 12px; font-size: 20px; font-weight: 700; }
.qz-h3 { margin: 18px 0 8px; font-size: 17px; font-weight: 700; }
.qz-muted { color: var(--ui-muted, #667085); }
.qz-stage .qz-muted { color: var(--qz-fg-muted, inherit); opacity: .9; }
.qz-small { font-size: 13px; }
.qz-spacer { flex: 1; }
.qz-nowrap { white-space: nowrap; }
.qz-num { text-align: right; font-variant-numeric: tabular-nums; }
.qz-inline { display: inline; margin: 0; }
.qz-back { display: inline-flex; align-items: center; gap: 6px; margin: 4px 0 10px; color: var(--ui-muted) !important; font-weight: 600; }

/* ---------- buttons and inputs ---------- */
.qz-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 14px;
    border: 1px solid var(--ui-border, #e1e6ed); border-radius: 10px; background: var(--ui-surface, #fff);
    color: var(--ui-text, #1b2430) !important; font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer;
    text-decoration: none !important; box-shadow: none; white-space: nowrap; transition: transform .1s, filter .15s;
}
.qz-btn:hover { filter: brightness(.97); }
.qz-btn:active { transform: translateY(1px); }
.qz-btn:disabled, .qz-btn[disabled] { opacity: .5; cursor: default; transform: none; }
.qz-btn-primary { background: var(--ui-primary, #1e3a5f); border-color: var(--ui-primary, #1e3a5f); color: #fff !important; }
.qz-btn-accent { background: #0b7a72; border-color: #0b7a72; color: #fff !important; }
.qz-btn-lg { min-height: 46px; padding: 0 20px; font-size: 16px; }
.qz-btn-xl { min-height: 56px; padding: 0 28px; font-size: 19px; border-radius: 14px; }
.qz-input, .qz-search input, .qz-pin-small {
    box-sizing: border-box; min-height: 40px; padding: 8px 12px; border: 1px solid var(--ui-border); border-radius: 10px;
    background: var(--ui-surface); color: var(--ui-text); font: inherit;
}
textarea.qz-input { width: 100%; resize: vertical; }
.qz-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.qz-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.qz-row-center { justify-content: center; margin-top: 18px; }

.qz-panel { background: var(--ui-surface, #fff); border: 1px solid var(--ui-border); border-radius: 14px; padding: 16px 18px;
    box-shadow: var(--ui-shadow, none); }
.qz-panel > .qz-h2:first-child { margin-top: 0; }
.qz-banner { margin: 12px 0; padding: 12px 16px; border-radius: 12px; font-weight: 600; }
.qz-banner-warn { background: #fff3d6; color: #7a4d00; border: 1px solid #f1d28a; }
:root[data-theme="dark"] .qz-banner-warn { background: #3a2f17; color: #f3d48c; border-color: #6b5222; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .qz-banner-warn { background: #3a2f17; color: #f3d48c; border-color: #6b5222; }
}
.qz-empty { padding: 40px 16px; text-align: center; color: var(--ui-muted); background: var(--qz-soft); border-radius: 14px; }
.qz-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--qz-soft); color: var(--ui-text) !important;
    font-size: 12px; font-weight: 600; text-decoration: none !important; }
.qz-tag-muted { color: var(--ui-muted) !important; }
.qz-tag-bad { background: #fbe1e6; color: #8f1d33 !important; }

/* ---------- catalog ---------- */
.qz-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 22px; margin: 6px 0 14px; border-radius: 18px;
    background: linear-gradient(135deg, var(--ui-primary, #1e3a5f), #0b7a72); color: #fff; }
.qz-hero .qz-muted { color: rgba(255, 255, 255, .85); margin: 6px 0 0; }
.qz-hero-text { flex: 1 1 260px; }
.qz-hero .qz-h1 { font-size: 34px; }
.qz-pin-box { flex: 0 1 380px; background: rgba(255, 255, 255, .14); padding: 12px; border-radius: 14px; }
.qz-pin-label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.qz-pin-row { display: flex; gap: 8px; }
.qz-pin-small { width: 9ch; flex: 1 1 auto; min-width: 0; font-size: 22px; font-weight: 800; letter-spacing: .15em; text-align: center;
    border: 0; min-height: 46px; }
.qz-hero .qz-btn-primary { background: #fff; color: var(--ui-primary, #1e3a5f) !important; border-color: #fff; }

.qz-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0; }
.qz-search { display: flex; gap: 6px; flex: 1 1 240px; max-width: 420px; }
.qz-search input { flex: 1; min-width: 0; }
.qz-seg { display: inline-flex; padding: 3px; border: 1px solid var(--ui-border); border-radius: 10px; background: var(--qz-soft); }
.qz-seg-item { padding: 6px 12px; border-radius: 8px; color: var(--ui-muted) !important; font-weight: 600; text-decoration: none !important; }
.qz-seg-item.qz-on { background: var(--ui-surface); color: var(--ui-text) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.qz-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 16px; }
.qz-chip { padding: 5px 12px; border: 1px solid var(--ui-border); border-radius: 999px; background: var(--ui-surface);
    color: var(--ui-text) !important; font-size: 13px; font-weight: 600; text-decoration: none !important; }
.qz-chip.qz-on { background: var(--ui-primary); border-color: var(--ui-primary); color: #fff !important; }

.qz-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.qz-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--ui-border); border-radius: 14px;
    background: var(--ui-surface); color: var(--ui-text) !important; text-decoration: none !important;
    box-shadow: var(--ui-shadow, none); transition: transform .15s, box-shadow .15s; }
.qz-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(16, 24, 40, .12); }
.qz-cover { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; overflow: hidden; }
.qz-cover:not(.qz-cover-blank) {
    background: var(--qz-soft); }
.qz-cover img { width: 100%; height: 100%; object-fit: cover; }
.qz-cover-blank b { position: relative; font-size: 46px; font-weight: 800; opacity: .9; }
.qz-cover-blank .qz-ornament { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.qz-card-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.qz-card-title { font-weight: 700; font-size: 16px; line-height: 1.3; color: var(--ui-text) !important; }
.qz-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--ui-muted); font-size: 13px; }
.qz-card-author { margin-left: auto; }
.qz-card .qz-tag { align-self: flex-start; }
.qz-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 22px 0; }
.qz-pages a, .qz-pages span { min-width: 36px; padding: 6px 10px; border-radius: 8px; text-align: center; text-decoration: none !important; }
.qz-pages a { border: 1px solid var(--ui-border); background: var(--ui-surface); color: var(--ui-text) !important; }
.qz-pages .qz-on { background: var(--ui-primary); color: #fff; font-weight: 700; }

/* ---------- quiz page ---------- */
.qz-detail-head { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 16px; }
.qz-cover-big { flex: 0 0 300px; max-width: 100%; border-radius: 16px; }
.qz-detail-info { flex: 1 1 320px; min-width: 0; }
.qz-detail-info .qz-card-meta { margin-top: 8px; }
.qz-desc { margin: 12px 0 0; white-space: pre-line; }
.qz-detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-bottom: 16px; }
.qz-modes { display: grid; gap: 8px; }
.qz-mode { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--ui-border); border-radius: 12px;
    cursor: pointer; }
.qz-mode:has(input:checked) { border-color: var(--ui-accent, #4c8dff); background: var(--qz-soft); }
.qz-mode input { margin-top: 4px; }
.qz-mode span { display: flex; flex-direction: column; gap: 2px; }
.qz-mode small { color: var(--ui-muted); font-size: 13px; }
.qz-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 6px; }
.qz-checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.qz-solo { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.qz-solo .qz-input { flex: 1 1 160px; }
.qz-qlist { margin: 0; padding-left: 26px; }
.qz-qlist li { padding: 7px 0; border-bottom: 1px solid var(--ui-border); }
.qz-qlist li:last-child { border-bottom: 0; }
.qz-qtype { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 6px; background: var(--qz-soft);
    font-size: 12px; font-weight: 700; color: var(--ui-muted); white-space: nowrap; }
.qz-qmeta { float: right; margin-left: 8px; color: var(--ui-muted); font-size: 13px; }
.qz-qimg { clear: both; margin: 8px 0 2px; }
.qz-qimg a { display: inline-block; max-width: 100%; }
.qz-qimg img { display: block; max-width: min(100%, 360px); max-height: 220px; width: auto; height: auto;
    border-radius: 8px; border: 1px solid var(--ui-border); background: var(--qz-soft); cursor: zoom-in; }
.qz-qimg figcaption { margin-top: 3px; font-size: 12px; color: var(--ui-muted); }
.qz-qimg figcaption a { color: inherit; text-decoration: underline; }
.qz-complain { margin: 18px 0 30px; color: var(--ui-muted); background: none !important; border: 0 !important; padding: 0 !important; }
.qz-complain summary { cursor: pointer; font-size: 13px; }
.qz-complain form { display: grid; gap: 8px; max-width: 520px; margin-top: 8px; }
.qz-complain .qz-btn { justify-self: start; }

/* ---------- tables ---------- */
.qz-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.qz-table { width: 100%; border-collapse: collapse; background: var(--ui-surface); border-radius: 12px; overflow: hidden; }
.qz-table th, .qz-table td { padding: 8px 10px; border-bottom: 1px solid var(--ui-border); text-align: left; vertical-align: middle; }
.qz-table th { background: var(--qz-soft); font-size: 13px; color: var(--ui-muted); font-weight: 700; }
.qz-table th.qz-num, .qz-table td.qz-num { text-align: right; }
.qz-records-mini { margin-top: 4px; font-size: 14px; }
.qz-place { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--qz-soft); font-weight: 800; }
.qz-top1 .qz-place { background: #e9b949; color: #3d2a00; }
.qz-top2 .qz-place { background: #c5ccd6; color: #222; }
.qz-top3 .qz-place { background: #d79a68; color: #3a1d05; }
.qz-records-table { max-width: 640px; }
.qz-records .qz-solo { margin-top: 18px; }
.qz-meter { display: inline-block; width: 80px; height: 8px; margin-right: 6px; border-radius: 4px; background: var(--qz-soft); overflow: hidden;
    vertical-align: middle; }
.qz-meter span { display: block; height: 100%; }
.qz-meter .qz-ok { background: var(--qz-ok); }
.qz-meter .qz-mid { background: var(--qz-part); }
.qz-meter .qz-bad { background: var(--qz-bad); }
.qz-grid { font-size: 14px; }
.qz-grid th, .qz-grid td { padding: 6px 8px; }
.qz-cell { text-align: center !important; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.qz-cell-ok { background: rgba(29, 138, 92, .16); color: #13643f; }
.qz-cell-part { background: rgba(201, 128, 15, .18); color: #7d4e00; }
.qz-cell-bad { background: rgba(201, 58, 82, .15); color: #9b1f36; }
.qz-cell-none { color: var(--ui-muted); }
.qz-cell-info { color: var(--ui-muted); }
:root[data-theme="dark"] .qz-cell-ok { color: #7fdcae; }
:root[data-theme="dark"] .qz-cell-part { color: #f2c26b; }
:root[data-theme="dark"] .qz-cell-bad { color: #ff9aac; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .qz-cell-ok { color: #7fdcae; }
    :root:not([data-theme="light"]) .qz-cell-part { color: #f2c26b; }
    :root:not([data-theme="light"]) .qz-cell-bad { color: #ff9aac; }
}
.qz-removed td { opacity: .55; }

/* ---------- my quizzes ---------- */
.qz-mylist { display: grid; gap: 8px; }
.qz-myrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ui-border); border-radius: 12px;
    background: var(--ui-surface); }
.qz-cover-tiny { flex: 0 0 64px; width: 64px; border-radius: 10px; }
.qz-cover-tiny b { font-size: 24px; }
.qz-myrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

/* ---------- message ---------- */
.qz-message-box { max-width: 520px; margin: 40px auto; text-align: center; }
.qz-message-icon { font-size: 40px; color: var(--ui-accent, #4c8dff); }
.qz-message-text { font-size: 18px; margin: 10px 0; }
.qz-message .qz-actions { justify-content: center; }

/* ---------- join ---------- */
.qz-join { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70vh; padding: 16px 0;
    color: var(--ui-text); }
.qz-join-card { width: 100%; max-width: 420px; box-sizing: border-box; padding: 26px 22px; border-radius: 22px; text-align: center;
    background: var(--ui-surface); border: 1px solid var(--ui-border); box-shadow: 0 10px 40px rgba(16, 24, 40, .12); }
.qz-join-logo { display: inline-grid; place-items: center; width: 60px; height: 60px; margin-bottom: 6px; border-radius: 18px;
    background: linear-gradient(135deg, #0b7a72, #6a48c4); color: #fff; font-size: 30px; }
.qz-join-form { display: grid; gap: 12px; margin-top: 16px; }
.qz-join-label { font-weight: 700; color: var(--ui-muted); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.qz-join-input { box-sizing: border-box; width: 100%; padding: 12px; border: 2px solid var(--ui-border); border-radius: 16px;
    background: var(--ui-bg); color: var(--ui-text); font: inherit; text-align: center; outline: none; }
.qz-join-input:focus { border-color: var(--ui-accent, #4c8dff); outline: none !important; box-shadow: none !important; }
.qz-join-digits { font-size: 44px; font-weight: 800; letter-spacing: .22em; font-variant-numeric: tabular-nums; padding-left: .22em; }
.qz-join-nick { font-size: 26px; font-weight: 700; }
.qz-join-error { margin: 0; color: var(--qz-bad, #c93a52); font-weight: 700; }
.qz-join-pin { margin: 0; color: var(--ui-muted); }
.qz-join-pin b { color: var(--ui-text); font-size: 20px; letter-spacing: .08em; }
.qz-join-foot { margin-top: 18px; }
.qz-join .qz-btn-xl { width: 100%; }

/* ======================================================================= the game stage */
body.qz-game-page { overflow: hidden; }
.qz-stage {
    --qz-ok: #1d9a63; --qz-bad: #d0435b; --qz-part: #d08a15;
    position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 2000; display: flex; flex-direction: column; overflow: hidden;
    color: var(--qz-fg, var(--ui-text)); background-color: var(--ui-bg);
    font-size: 16px; -webkit-tap-highlight-color: transparent;
}
.qz-stage-bg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 0; pointer-events: none; }
.qz-stage > * { position: relative; z-index: 1; }
.qz-stage > .qz-stage-bg { position: absolute; z-index: 0; }
.qz-topbar { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; box-sizing: border-box;
    background: var(--qz-panel, var(--ui-surface)); backdrop-filter: blur(6px); }
.qz-bar-q { font-weight: 700; white-space: nowrap; }
.qz-bar-title { font-weight: 800; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-bar-score { padding: 4px 10px; border-radius: 999px; background: rgba(127, 127, 127, .18); font-weight: 800;
    font-variant-numeric: tabular-nums; }
.qz-bar-nick { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; opacity: .85; }
.qz-bar-count, .qz-bar-pin { font-weight: 700; white-space: nowrap; }
.qz-bar-pin b { letter-spacing: .08em; }
.qz-icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px;
    background: rgba(127, 127, 127, .18); color: inherit !important; font-size: 18px; cursor: pointer; box-shadow: none; }
.qz-topbar .qz-ring { width: 40px; height: 40px; font-size: 8px; }
.qz-topbar .qz-ring-wrap { display: inline-grid; }
.qz-ring-wrap:not(.qz-ring) { position: relative; place-items: center; width: 40px; height: 40px; }
.qz-ring-svg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; transform: rotate(-90deg); }
.qz-ring-bg, .qz-ring-fg { fill: none; stroke-width: 5; }
.qz-ring-bg { stroke: currentColor; opacity: .15; }
.qz-ring-fg { stroke: #0b7a72; transition: stroke-dashoffset .2s linear; }
.qz-ring-late .qz-ring-fg { stroke: #d63a3a; }
.qz-corner-pin { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.qz-corner-pin b { font-size: 22px; letter-spacing: .08em; }
.qz-corner-pin img { width: 56px; height: 56px; padding: 3px; border-radius: 8px; background: #fff; }

.qz-net { padding: 8px 12px; background: #b3261e; color: #fff; text-align: center; font-weight: 700; }
.qz-screen { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch;
    padding: 14px 14px 24px; box-sizing: border-box; }
.qz-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 100%;
    text-align: center; box-sizing: border-box; }
.qz-msg h2 { margin: 0; }
.qz-msg-icon { font-size: 54px; opacity: .85; }
.qz-enter { animation: qz-enter .35s ease-out both; }
@keyframes qz-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* waiting dots */
.qz-wait { display: inline-flex; gap: 10px; padding: 10px; }
.qz-wait i { width: 14px; height: 14px; border-radius: 50%; background: currentColor; opacity: .3; animation: qz-dot 1.2s ease-in-out infinite; }
.qz-wait i:nth-child(2) { animation-delay: .2s; }
.qz-wait i:nth-child(3) { animation-delay: .4s; }
.qz-wait-small i { width: 9px; height: 9px; }
.qz-wait-text { margin: 0; opacity: .85; }
@keyframes qz-dot { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

.qz-toast { position: absolute; left: 50%; bottom: 90px; z-index: 30; max-width: 90%; padding: 10px 16px; border-radius: 12px;
    background: rgba(20, 20, 28, .92); color: #fff; font-weight: 600; transform: translate(-50%, 20px); opacity: 0;
    pointer-events: none; transition: opacity .2s, transform .2s; }
.qz-toast.qz-on { opacity: 1; transform: translate(-50%, 0); }
.qz-pause { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 25; display: grid; place-items: center; background: rgba(10, 12, 20, .55);
    color: #fff; backdrop-filter: blur(3px); pointer-events: none; }
.qz-pause div { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 28px; }
.qz-pause i { font-size: 60px; }
.qz-role-screen .qz-pause, .qz-role-remote .qz-pause { bottom: 64px; }

/* 3-2-1 */
.qz-countdown { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 20; display: grid; place-items: center; pointer-events: none;
    background: radial-gradient(circle, rgba(0, 0, 0, .25), rgba(0, 0, 0, 0) 70%); }
.qz-countdown b { color: #fff; text-shadow: 0 6px 30px rgba(0, 0, 0, .45); }
.qz-countdown b:not(.qz-count) { font-size: 120px; }
.qz-screen { position: relative; }
.qz-q, .qz-host-q { position: relative; }

/* ---------- question ---------- */
.qz-q { max-width: 760px; min-height: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.qz-q-head { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--qz-panel, var(--ui-surface)); }
.qz-q-badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qz-q-type { display: inline-block; padding: 2px 10px; border-radius: 999px; background: rgba(127, 127, 127, .2); font-size: 12px;
    font-weight: 700; letter-spacing: .02em; }
.qz-badge { padding: 2px 8px; border-radius: 999px; background: rgba(127, 127, 127, .2); font-size: 12px; font-weight: 700; }
.qz-badge-x2 { background: #d08a15; color: #fff; }
.qz-q-text { font-size: 20px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.qz-q-text p { margin: 0 0 .4em; }
.qz-q-text p:last-child { margin-bottom: 0; }
.qz-q-text img { max-width: 100%; }
.qz-code { margin: 0; padding: 12px 14px; border-radius: 12px; background: #161a22; color: #e6edf3; overflow-x: auto;
    font: 15px/1.5 'JetBrains Mono', Consolas, 'Courier New', monospace; tab-size: 4; white-space: pre; text-align: left; }
.qz-code code { background: none; color: inherit; padding: 0; font: inherit; white-space: pre; }
.qz-q-img { text-align: center; }
.qz-q-img img { max-width: 100%; max-height: 38vh; border-radius: 12px; object-fit: contain; }
.qz-hint { margin: 0; font-weight: 600; opacity: .85; text-align: center; }
.qz-answer { flex: 1; display: flex; flex-direction: column; gap: 12px; transition: opacity .2s, filter .2s; }
.qz-answer > .qz-opts:not(.qz-opts-long):not(.qz-opts-multi) .qz-opt { min-height: 110px; }
.qz-answer.qz-locked { opacity: .35; filter: blur(2px); pointer-events: none; }
.qz-answer.qz-sending { opacity: .7; pointer-events: none; }
.qz-timeup { text-align: center; font-size: 20px; font-weight: 800; }
.qz-submit { align-self: stretch; }

/* answer buttons */
.qz-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.qz-opts-long, .qz-opts-tf { grid-template-columns: 1fr; }
.qz-opts-tf { grid-template-columns: 1fr 1fr; }
.qz-opt { position: relative; display: flex; align-items: center; gap: 12px; min-height: 84px; padding: 12px 14px; border: 0;
    border-radius: 16px; font: inherit; font-size: 18px; font-weight: 700; text-align: left; cursor: pointer;
    box-shadow: 0 4px 0 rgba(0, 0, 0, .22); transition: transform .08s, box-shadow .08s, opacity .2s; }
.qz-opts-long .qz-opt { min-height: 62px; }
button.qz-opt:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .22); }
.qz-opt .qz-shape-box { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; font-size: 22px; }
.qz-opt .qz-shape-box .qz-shape { width: 30px; height: 30px; }
.qz-opt-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.qz-opt-text { overflow-wrap: anywhere; }
.qz-opt-img { max-width: 100%; max-height: 120px; border-radius: 8px; object-fit: contain; align-self: flex-start; background: #fff; }
.qz-opt.qz-chosen { outline: 4px solid currentColor; outline-offset: -4px; }
.qz-opts-multi .qz-opt { opacity: .78; }
.qz-opts-multi .qz-opt.qz-on { opacity: 1; outline: 4px solid #fff; outline-offset: -6px; }
.qz-check { display: grid; place-items: center; width: 28px; height: 28px; margin-left: auto; flex: none; border: 3px solid currentColor;
    border-radius: 8px; font-size: 16px; color: transparent !important; }
.qz-opt.qz-on .qz-check { background: #fff; color: #111 !important; border-color: #fff; }
.qz-shape-letter { font-weight: 800; }

/* order */
.qz-order { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.qz-order-item { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 10px; border-radius: 14px;
    font-weight: 700; font-size: 17px; touch-action: none; user-select: none; cursor: grab; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); }
.qz-order-show .qz-order-item { cursor: default; touch-action: auto; }
.qz-order-item.qz-dragging { z-index: 5; cursor: grabbing; box-shadow: 0 12px 28px rgba(0, 0, 0, .35); transform-origin: center; }
.qz-grip { opacity: .75; padding: 0 4px; }
.qz-order-btns { display: flex; flex-direction: column; gap: 4px; margin-left: auto; }
.qz-mini { width: 38px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .25);
    color: inherit !important; cursor: pointer; box-shadow: none; }

/* word tiles */
.qz-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.qz-tile { display: inline-grid; place-items: center; min-width: 46px; height: 52px; padding: 0 6px; box-sizing: border-box;
    border: 0; border-radius: 12px; background: var(--qz-panel, var(--ui-surface)); color: inherit !important; font: inherit;
    font-size: 24px; font-weight: 800; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); cursor: pointer; text-transform: uppercase; }
.qz-tile-on { background: #0b7a72; color: #fff !important; }
.qz-tile-used { opacity: .25; box-shadow: none; }
.qz-tile-slot { background: transparent; border: 2px dashed currentColor; opacity: .35; box-shadow: none; cursor: default; }
.qz-tiles-answer { min-height: 56px; }
.qz-tiles-key .qz-tile { background: #1d9a63; color: #fff !important; }
.qz-row > .qz-submit { flex: 1; }

/* typed answers, slider */
.qz-field { box-sizing: border-box; width: 100%; padding: 14px 16px; border: 2px solid rgba(127, 127, 127, .4); border-radius: 14px;
    background: var(--qz-panel, var(--ui-surface)); color: inherit; font: inherit; font-size: 22px; font-weight: 600; outline: none; }
.qz-field:focus { border-color: #0b7a72; }
textarea.qz-field { font-size: 18px; resize: vertical; }
.qz-slider-value { display: block; text-align: center; font-size: 46px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qz-range { width: 100%; height: 44px; accent-color: #0b7a72; cursor: pointer; }
.qz-range-ends { display: flex; justify-content: space-between; font-weight: 700; opacity: .8; }

/* pin on image */
.qz-pin-wrap { position: relative; display: block; width: fit-content; max-width: 100%; margin: 0 auto; line-height: 0; }
.qz-pin-wrap img { display: block; max-width: 100%; max-height: 60vh; border-radius: 12px; user-select: none; -webkit-user-drag: none; }
.qz-pin-input { cursor: crosshair; touch-action: manipulation; }
.qz-pin-marker { position: absolute; width: 28px; height: 28px; margin: -28px 0 0 -14px; pointer-events: none;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 23s-8-8.3-8-13.5A8 8 0 0 1 20 9.5C20 14.7 12 23 12 23z' fill='%23b42358' stroke='%23fff' stroke-width='1.5'/%3E%3Ccircle cx='12' cy='9.5' r='3' fill='%23fff'/%3E%3C/svg%3E");
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .4)); animation: qz-pop .3s both; }
.qz-pin-target { position: absolute; transform: translate(-50%, -50%); border: 3px solid #1d9a63; border-radius: 50%;
    background: rgba(29, 154, 99, .22); box-shadow: 0 0 0 2px rgba(255, 255, 255, .6); }
.qz-pin-dot { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #6a48c4;
    border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .4); animation: qz-pop .35s both; }

/* ---------- player screens ---------- */
.qz-lobby-me h2, .qz-answered h2 { margin: 0; font-size: 28px; }
.qz-me-badge { display: grid; place-items: center; width: 92px; height: 92px; border-radius: 50%; background: #0b7a72; color: #fff;
    font-size: 42px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.qz-me-nick { margin: 0; font-size: 24px; font-weight: 800; padding: 6px 18px; border-radius: 999px; background: var(--qz-panel, var(--ui-surface)); }

.qz-reveal { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.qz-verdict { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px; border-radius: 20px; color: #fff;
    text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.qz-verdict h2 { margin: 0; font-size: 32px; color: inherit; }
.qz-verdict-icon { font-size: 40px; }
.qz-v-ok { background: var(--qz-ok); }
.qz-v-bad { background: var(--qz-bad); }
.qz-v-part { background: var(--qz-part); }
.qz-v-none { background: #5d6472; }
.qz-v-info { background: #1c66a8; }
.qz-points-row { font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.qz-place-line { margin: 0; font-size: 18px; font-weight: 700; opacity: .95; }
.qz-streak { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #d08a15; color: #fff; font-weight: 800;
    font-size: 13px; white-space: nowrap; }
.qz-streak-big { font-size: 17px; padding: 4px 14px; background: rgba(0, 0, 0, .22); }
.qz-reveal-body { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; background: var(--qz-panel, var(--ui-surface)); }
.qz-q-mini { font-weight: 700; opacity: .9; }
.qz-q-mini p { margin: 0; }
.qz-key-text { margin: 0; font-size: 18px; text-align: center; overflow-wrap: anywhere; }
.qz-explain { padding: 10px 12px; border-left: 4px solid #0b7a72; border-radius: 8px; background: rgba(127, 127, 127, .12); }
.qz-explain p { margin: 4px 0 0; }
.qz-explain a { color: inherit !important; text-decoration: underline; }
.qz-summary { margin: 0; text-align: center; font-size: 18px; }
.qz-sticky-actions { position: sticky; bottom: 0; display: flex; justify-content: center; padding: 10px 0 4px; }
.qz-sticky-actions .qz-btn { width: 100%; max-width: 420px; }

.qz-board-view { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.qz-my-place { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px; border-radius: 20px;
    background: var(--qz-panel, var(--ui-surface)); text-align: center; }
.qz-my-place b { font-size: 48px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.qz-board { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.qz-board-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--qz-panel, var(--ui-surface));
    font-weight: 700; }
.qz-board-row.qz-me { outline: 3px solid #0b7a72; }
.qz-board-place { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 50%;
    background: rgba(127, 127, 127, .22); font-variant-numeric: tabular-nums; }
.qz-board-row:nth-child(1) .qz-board-place { background: #e9b949; color: #3d2a00; }
.qz-board-row:nth-child(2) .qz-board-place { background: #c5ccd6; color: #222; }
.qz-board-row:nth-child(3) .qz-board-place { background: #d79a68; color: #3a1d05; }
.qz-av { display: inline-block; flex: none; line-height: 0; border-radius: 50%; vertical-align: middle; }
.qz-av svg { display: block; width: 100%; height: 100%; }
.qz-av-s { width: 24px; height: 24px; }
.qz-av-m { width: 34px; height: 34px; }
.qz-av-l { width: 56px; height: 56px; }
.qz-av-xl { width: clamp(88px, 16vw, 140px); height: clamp(88px, 16vw, 140px); }
.qz-board-big .qz-av { width: clamp(30px, 3.4vw, 52px); height: clamp(30px, 3.4vw, 52px); }
.qz-av-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; max-height: 38vh; overflow-y: auto; padding: 4px; margin: 6px 0 12px; }
.qz-av-pick { padding: 3px; border: 3px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; line-height: 0; }
.qz-av-pick .qz-av { width: 100%; height: auto; aspect-ratio: 1; }
.qz-av-pick.qz-on { border-color: var(--qz-accent, #d0435b); background: rgba(127, 127, 127, .18); transform: scale(1.06); }
.qz-name .qz-av { width: 32px; height: 32px; margin: -6px 10px -6px -10px; }
.qz-pod .qz-av { width: clamp(44px, 6vw, 84px); height: clamp(44px, 6vw, 84px); }
.qz-me-av { margin: 6px auto; }
.qz-bar-nick .qz-av { width: 24px; height: 24px; margin-right: 6px; }
.qz-board-nick { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-board-score { font-variant-numeric: tabular-nums; }
.qz-delta { color: var(--qz-ok); font-weight: 800; font-size: .85em; }
.qz-board-row.qz-up { animation: qz-up 1.2s ease-out; }
@keyframes qz-up { 0%, 60% { box-shadow: 0 0 0 3px #1d9a63; } 100% { box-shadow: none; } }

/* final */
.qz-final { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.qz-final-title { margin: 0; text-align: center; font-size: 30px; font-weight: 800; }
.qz-podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; min-height: 230px; padding-top: 10px; }
.qz-pod { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 0 1 140px; min-width: 0;
    animation: qz-rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.qz-pod-nick { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 17px; }
.qz-pod-score { font-weight: 700; opacity: .85; font-variant-numeric: tabular-nums; }
.qz-pod-block { display: grid; place-items: start center; width: 100%; padding-top: 10px; border-radius: 12px 12px 0 0; color: #fff;
    box-shadow: inset 0 -10px 20px rgba(0, 0, 0, .15); }
.qz-pod-block b { font-size: 40px; }
.qz-pod-1 .qz-pod-block { height: 150px; background: linear-gradient(#e9b949, #c08d1c); color: #3d2a00; }
.qz-pod-2 .qz-pod-block { height: 110px; background: linear-gradient(#c5ccd6, #8f99a7); color: #222; }
.qz-pod-3 .qz-pod-block { height: 80px; background: linear-gradient(#d79a68, #a5683a); color: #3a1d05; }
.qz-pod-empty { visibility: hidden; }
.qz-pod.qz-me .qz-pod-nick { text-decoration: underline 3px; text-underline-offset: 5px; }
.qz-mistakes { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.qz-mistakes li { display: flex; gap: 10px; padding: 12px; border-radius: 14px; background: var(--qz-panel, var(--ui-surface)); }
.qz-mistakes p { margin: 2px 0; overflow-wrap: anywhere; }
.qz-mistake-n { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
    background: var(--qz-bad); color: #fff; font-weight: 800; }
.qz-mistake-q { font-weight: 700; }

/* reveal statistics: horizontal bars on phones, columns on the projector */
.qz-viz { display: flex; flex-direction: column; gap: 10px; }
.qz-sbars { display: flex; flex-direction: column; gap: 8px; }
.qz-sbar { display: flex; flex-direction: column-reverse; gap: 4px; }
.qz-sbar-label { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.qz-sbar-label .qz-shape-box { display: inline-grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 8px; font-size: 14px; }
.qz-sbar-label .qz-shape { width: 18px; height: 18px; }
.qz-sbar-label .qz-opt-img { max-height: 48px; }
.qz-sbar-track { position: relative; display: flex; align-items: center; height: 28px; border-radius: 8px; background: rgba(127, 127, 127, .15); }
.qz-sbar-fill { display: block; height: 100%; width: calc(var(--p, 0) * 100%); min-width: 4px; border-radius: 8px;
    transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.qz-sbar-n { position: absolute; right: 8px; font-variant-numeric: tabular-nums; }
.qz-sbar.qz-dim .qz-sbar-fill { opacity: .45; }
.qz-sbar.qz-right .qz-sbar-label { color: inherit; }
.qz-tick { color: var(--qz-ok); font-size: 1.2em; }
.qz-mine-tag { padding: 0 6px; border-radius: 6px; background: rgba(127, 127, 127, .25); font-size: 12px; }
.qz-sbar.qz-mine .qz-sbar-track { box-shadow: 0 0 0 2px currentColor; }
.qz-order-key { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: qzo; }
.qz-order-key li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; font-weight: 700; }
.qz-order-key li::before { counter-increment: qzo; content: counter(qzo) '.'; font-weight: 800; }
.qz-order-key .qz-shape-box { display: none; }

.qz-hist-box { display: flex; flex-direction: column; gap: 6px; }
.qz-hist { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 150px; padding: 0 2px;
    border-bottom: 2px solid rgba(127, 127, 127, .5); }
.qz-hist-col { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.qz-hist-fill { display: block; width: 100%; height: calc(var(--p, 0) * 85%); min-height: 2px; border-radius: 4px 4px 0 0; background: #6a48c4;
    opacity: .6; transition: height .9s cubic-bezier(.2, .8, .2, 1); }
.qz-hist-col.qz-right .qz-hist-fill { background: #1d9a63; opacity: 1; }
.qz-hist-col b { position: absolute; bottom: calc(var(--p, 0) * 85% + 2px); font-size: 12px; }
.qz-hist-mark { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: #1d9a63; }
.qz-hist-mine { position: absolute; bottom: -10px; width: 0; height: 0; margin-left: -7px; border: 7px solid transparent;
    border-bottom-color: currentColor; }
.qz-hist-axis { display: flex; justify-content: space-between; font-weight: 700; opacity: .8; font-size: 13px; }

.qz-cloud { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; padding: 10px; }
.qz-cloud-word { padding: .05em .4em; border-radius: .35em; font-weight: 800; line-height: 1.2; animation: qz-pop .4s both; }
.qz-open-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.qz-open-card { position: relative; padding: 12px 14px; border-radius: 12px; background: rgba(127, 127, 127, .15); font-weight: 600;
    overflow-wrap: anywhere; }
.qz-open-card.qz-hidden-text > span { filter: blur(6px); opacity: .4; }
.qz-open-hide { display: block; margin-top: 6px; padding: 0; border: 0; background: none; color: inherit !important; opacity: .7;
    font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; box-shadow: none; }

/* ---------- host: controls ---------- */
.qz-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px; background: var(--qz-panel, var(--ui-surface));
    backdrop-filter: blur(6px); }
.qz-ctl { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px;
    background: rgba(127, 127, 127, .2); color: inherit !important; font: inherit; font-weight: 700; cursor: pointer; box-shadow: none;
    text-decoration: none !important; }
.qz-ctl:disabled { opacity: .35; cursor: default; }
.qz-ctl-main, .qz-ctl-main:hover, .qz-ctl-main:focus { background: #0b7a72; color: #fff !important; padding: 0 22px; }
.qz-ctl:hover:not(:disabled) { filter: brightness(1.08); }
.qz-ctl-end { background: rgba(208, 67, 91, .85); color: #fff !important; }
.qz-controls-done .qz-ctl-main { display: none; }

/* ---------- host: lobby ---------- */
.qz-lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 22px; min-height: 100%; align-items: stretch; }
.qz-lobby-join { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px;
    border-radius: 22px; background: var(--qz-panel, var(--ui-surface)); text-align: center; }
.qz-lobby-steps p { margin: 4px 0; font-size: clamp(18px, 2.2vw, 28px); }
.qz-lobby-url { overflow-wrap: anywhere; }
.qz-lobby-pin { white-space: nowrap; font-size: clamp(48px, 6.6vw, 120px); font-weight: 900; letter-spacing: .06em; line-height: 1.05;
    font-variant-numeric: tabular-nums; }
.qz-lobby-qr { width: min(22vw, 34vh, 300px); min-width: 140px; height: auto; aspect-ratio: 1; padding: 10px; border-radius: 16px; background: #fff; }
.qz-lobby-players { display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: 22px; background: var(--qz-panel, var(--ui-surface));
    min-height: 0; }
.qz-lobby-top { display: flex; align-items: center; gap: 12px; }
.qz-lobby-count { display: flex; align-items: baseline; gap: 8px; }
.qz-lobby-count b { font-size: clamp(36px, 5vw, 64px); font-weight: 900; font-variant-numeric: tabular-nums; }
.qz-lobby-count small { font-size: 20px; font-weight: 700; }
.qz-names { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; overflow-y: auto; max-height: 60vh; }
.qz-names-empty { font-size: 20px; }
.qz-name { padding: 8px 14px; border: 0; border-radius: 999px; background: rgba(127, 127, 127, .2); color: inherit !important;
    font: inherit; font-size: clamp(15px, 1.6vw, 22px); font-weight: 800; cursor: pointer; box-shadow: none; }
.qz-name:hover { background: rgba(208, 67, 91, .85); color: #fff !important; text-decoration: line-through; }

/* ---------- host: question, reveal, board ---------- */
.qz-host-q { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; max-width: 1500px; margin: 0 auto; min-height: 100%; }
.qz-host-q-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.qz-q-head.qz-big .qz-q-text { font-size: clamp(24px, 3vw, 44px); }
.qz-q-head.qz-big .qz-code { font-size: clamp(16px, 1.6vw, 24px); }
.qz-q-head.qz-big .qz-q-img img { max-height: 42vh; }
.qz-opts-show .qz-opt { min-height: 96px; font-size: clamp(18px, 2.2vw, 30px); cursor: default; }
.qz-opts-show .qz-opt .qz-shape-box { width: 48px; height: 48px; }
.qz-opts-show .qz-opt .qz-shape-box .qz-shape { width: 42px; height: 42px; }
.qz-order-show .qz-order-item { font-size: clamp(18px, 2vw, 28px); }
.qz-tiles-show .qz-tile { min-width: 64px; height: 72px; font-size: 36px; cursor: default; }
.qz-hint-big { margin: 10px 0; text-align: center; font-size: clamp(20px, 2.4vw, 34px); font-weight: 700; opacity: .9; }
.qz-host-side { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 10px; }
.qz-ring-big.qz-ring { width: 180px; height: 180px; font-size: 26px; }
.qz-ring-big:not(.qz-ring) { width: 180px; height: 180px; font-size: 40px; }
.qz-answered-box { display: flex; flex-direction: column; align-items: center; padding: 14px 18px; border-radius: 18px;
    background: var(--qz-panel, var(--ui-surface)); text-align: center; }
.qz-answered-box > b { font-size: 56px; line-height: 1; font-variant-numeric: tabular-nums; }
.qz-answered-box small { font-size: 16px; opacity: .85; }
.qz-answered-inline { flex-direction: row; justify-content: center; gap: 6px; font-size: 20px; }
.qz-answered-inline b { font-size: 26px; }

.qz-host-reveal { display: flex; flex-direction: column; gap: 16px; max-width: 1400px; margin: 0 auto; }
.qz-host-reveal-q { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 14px 18px; border-radius: 16px;
    background: var(--qz-panel, var(--ui-surface)); }
.qz-host-reveal-q .qz-q-text { font-size: clamp(20px, 2.4vw, 32px); }
.qz-host-reveal .qz-viz { padding: 16px; border-radius: 18px; background: var(--qz-panel, var(--ui-surface)); }
.qz-host-reveal .qz-summary { font-size: 24px; }
.qz-host-reveal .qz-key-text { font-size: 26px; }
.qz-host-reveal .qz-explain { font-size: 20px; background: var(--qz-panel, var(--ui-surface)); }
.qz-host-reveal .qz-cloud { font-size: clamp(16px, 1.8vw, 26px); min-height: 30vh; }
.qz-host-reveal .qz-pin-wrap img { max-height: 55vh; }
.qz-host-reveal .qz-hist { height: 34vh; }
.qz-host-reveal .qz-open-card { font-size: 20px; }

.qz-host-board { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.qz-board-title { margin: 0; text-align: center; font-size: clamp(30px, 4vw, 54px); font-weight: 800; }
.qz-board-big .qz-board-row { padding: 14px 22px; font-size: clamp(20px, 2.6vw, 36px); border-radius: 18px; }
.qz-board-big .qz-board-place { width: 1.6em; height: 1.6em; }
.qz-final-host .qz-podium { min-height: 360px; }
.qz-final-host .qz-pod { flex-basis: 240px; }
.qz-final-host .qz-pod-nick { font-size: clamp(20px, 2.6vw, 34px); }
.qz-final-host .qz-pod-1 .qz-pod-block { height: 230px; }
.qz-final-host .qz-pod-2 .qz-pod-block { height: 170px; }
.qz-final-host .qz-pod-3 .qz-pod-block { height: 120px; }
.qz-final-host { max-width: 1000px; }
.qz-final-host .qz-muted { text-align: center; }

/* projector screen: answers as columns */
@media (min-width: 900px) {
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) { flex-direction: row; align-items: stretch; height: 40vh; gap: 18px; justify-content: center; }
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar { flex: 0 1 220px; flex-direction: column-reverse; min-width: 0; }
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar-track { flex: 1; flex-direction: column; justify-content: flex-end;
        height: auto; background: none; }
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar-fill { width: 100%; height: calc(var(--p, 0) * 88%); min-height: 6px;
        border-radius: 10px 10px 2px 2px; transition: height 1s cubic-bezier(.2, .8, .2, 1); }
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar-n { position: static; order: -1; font-size: 34px; margin-bottom: 6px; }
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar-label { justify-content: center; font-size: 22px; text-align: center; }
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar-label .qz-shape-box { width: 40px; height: 40px; }
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar-label .qz-shape { width: 30px; height: 30px; }
    .qz-role-screen .qz-sbars-text .qz-sbar-label { font-size: 22px; }
    .qz-role-screen .qz-sbars-text .qz-sbar-track { height: 38px; }
    .qz-stage.qz-role-screen { font-size: 18px; }
    .qz-role-screen .qz-topbar { min-height: 70px; }
    .qz-role-screen .qz-bar-title { font-size: 20px; }
    .qz-role-screen .qz-bar-q { font-size: 20px; }
}

/* ---------- host: phone remote ---------- */
.qz-remote { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.qz-remote-pin { text-align: center; font-size: 22px; }
.qz-remote-pin b { font-size: 38px; letter-spacing: .06em; }
.qz-remote .qz-lobby-count { justify-content: center; }
.qz-remote .qz-start { width: 100%; }
.qz-remote-head { display: flex; align-items: center; justify-content: space-between; }
.qz-remote-timer { font-size: 30px; font-variant-numeric: tabular-nums; }
.qz-remote .qz-q-text { font-size: 18px; padding: 12px; border-radius: 14px; background: var(--qz-panel, var(--ui-surface)); }
.qz-remote-key { padding: 12px 14px; border-radius: 14px; background: rgba(29, 154, 99, .9); color: #fff; font-size: 18px; overflow-wrap: anywhere; }
.qz-remote-key .qz-muted { color: rgba(255, 255, 255, .85) !important; }
.qz-role-remote .qz-controls { position: sticky; bottom: 0; }
.qz-role-remote .qz-ctl { flex: 1 1 30%; justify-content: center; min-height: 52px; }
.qz-role-remote .qz-ctl-main { flex-basis: 100%; min-height: 60px; font-size: 20px; }

/* ---------- small screens ---------- */
@media (max-width: 899px) {
    .qz-lobby, .qz-host-q { grid-template-columns: 1fr; }
    .qz-host-side { flex-direction: row; justify-content: center; order: -1; padding: 0; }
    .qz-ring-big.qz-ring, .qz-ring-big:not(.qz-ring) { width: 90px; height: 90px; font-size: 13px; }
    .qz-ring-big:not(.qz-ring) { font-size: 26px; }
    .qz-ctl span { display: none; }
    .qz-ctl-main span, .qz-role-remote .qz-ctl span { display: inline; }
}
@media (max-width: 760px) {
    .qz-detail-grid { grid-template-columns: 1fr; }
    .qz-cover-big { flex-basis: 100%; }
    .qz-hide-sm { display: none; }
    .qz-hero { padding: 16px; }
    .qz-hero .qz-h1 { font-size: 28px; }
    .qz-qmeta { float: none; display: block; margin: 2px 0 0; }
}
@media (max-width: 420px) {
    .qz-screen { padding: 10px 10px 18px; }
    .qz-opt { min-height: 72px; font-size: 16px; padding: 10px; gap: 8px; }
    .qz-q-text { font-size: 18px; }
    .qz-bar-nick { display: none; }
    .qz-join-digits { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
    .qz-enter, .qz-wait i, .qz-pod, .qz-cloud-word, .qz-pin-dot, .qz-pin-marker, .qz-board-row.qz-up { animation: none !important; }
    .qz-sbar-fill, .qz-hist-fill { transition: none !important; }
}

/* ---------- late overrides ---------- */
.qz-btn-primary:hover, .qz-btn-primary:focus { background: var(--ui-primary-2, #2a4f82); color: #fff !important; }
.qz-btn-accent:hover, .qz-btn-accent:focus { background: #0a6b64; color: #fff !important; }
.qz-stage h2, .qz-stage h3 { color: inherit; font-weight: 800; }
@media (min-width: 900px) {
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar { flex-direction: column; }
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar-label { flex-direction: column; gap: 6px; }
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar-label .qz-opt-body { align-items: center; flex: none; }
    .qz-opts-show { flex: 1; grid-auto-rows: minmax(96px, 1fr); max-height: 52vh; }
    .qz-host-q-main .qz-hint-big, .qz-host-q-main .qz-tiles-show { margin-top: 4vh; }
}
@media (max-width: 420px) {
    .qz-tiles { gap: 6px; }
    .qz-tile { min-width: 38px; height: 48px; font-size: 21px; padding: 0 4px; }
}
.qz-topbar, .qz-controls, .qz-net { flex: none; }
.qz-role-remote .qz-bar-title { display: none; }
.qz-role-remote .qz-ctl:not(.qz-ctl-main) { flex: 1 1 0; min-width: 0; padding: 0; }
.qz-role-remote .qz-ctl:not(.qz-ctl-main) span { display: none; }
.qz-remote-url { text-align: center; overflow-wrap: anywhere; margin: 0; }

/* site-wide button:hover paints buttons blue: keep our own colours */
button.qz-btn:hover, button.qz-btn:focus { background: var(--ui-surface, #fff); }
button.qz-btn-primary:hover, button.qz-btn-primary:focus { background: var(--ui-primary-2, #2a4f82); }
button.qz-btn-accent:hover, button.qz-btn-accent:focus { background: #0a6b64; }
.qz-stage button.qz-opt, .qz-stage button.qz-opt:hover, .qz-stage button.qz-opt:focus { background: var(--qz-c); color: var(--qz-on, #fff) !important; }
.qz-stage button.qz-tile:hover, .qz-stage button.qz-tile:focus { background: var(--qz-panel, var(--ui-surface)); }
.qz-stage button.qz-tile-on:hover, .qz-stage button.qz-tile-on:focus { background: #0b7a72; }
.qz-stage button.qz-mini:hover, .qz-stage button.qz-icon-btn:hover, .qz-stage button.qz-ctl:not(.qz-ctl-main):not(.qz-ctl-end):hover {
    background: rgba(127, 127, 127, .3); }
.qz-stage button.qz-ctl-end:hover, .qz-stage button.qz-ctl-end:focus { background: rgba(208, 67, 91, .95); }
.qz-stage button.qz-ctl:disabled { background: rgba(127, 127, 127, .2); }
.qz-stage button.qz-open-hide:hover { background: none; }
.qz-stage button.qz-name:hover { background: rgba(208, 67, 91, .85); }
.qz-board-view .qz-wait { align-self: center; }
.qz-host-reveal .qz-order-key li { padding: 14px 18px; font-size: clamp(18px, 2.2vw, 30px); }
@media (min-width: 900px) {
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar-label { flex-direction: row; flex-wrap: wrap; justify-content: center;
        align-content: flex-start; min-height: 4.6em; }
    .qz-role-screen .qz-sbars:not(.qz-sbars-text) .qz-sbar-label .qz-opt-body { flex: 1 0 100%; order: 2; }
}
.qz-bar-qr { width: 40px; height: 40px; margin-left: 8px; border-radius: 6px; background: #fff; padding: 2px; }
.qz-remote-qr { display: block; width: 180px; height: 180px; margin: 4px auto; padding: 8px; border-radius: 14px; background: #fff; }

/* ======================================================================= in time with the music */
/* A soft glow that breathes with the kick drum (--qz-beat is set by game.js from QuizAudio.beat()). */
.qz-stage-bg::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none;
    background: radial-gradient(ellipse 70% 55% at 50% 105%, currentColor, transparent 70%);
    opacity: calc(var(--qz-beat, 0) * .16); transform: scale(calc(1 + var(--qz-beat, 0) * .03)); transform-origin: 50% 100%; }
/* Drum hits (start, 3-2-1, "go", leaderboard, podium): a short flash of the background. */
.qz-stage.qz-hit .qz-stage-bg { animation: qz-hit .55s ease-out; }
@keyframes qz-hit { 0% { filter: brightness(calc(1 + .35 * var(--qz-hit, 1))) saturate(1.25); } 100% { filter: none; } }
/* 3-2-1: every number lands with a shockwave ring. */
.qz-countdown b.qz-count { position: relative; }
.qz-countdown b.qz-count::after { content: ''; position: absolute; left: 50%; top: 50%; width: 1.1em; height: 1.1em;
    margin: -.55em 0 0 -.55em; border-radius: 50%; border: 6px solid rgba(255, 255, 255, .8);
    animation: qz-wave .7s ease-out both; pointer-events: none; }
@keyframes qz-wave { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
/* Leaderboard: the gained points pop in on the drum hit, a climber gets an arrow. */
.qz-host-board .qz-delta { display: inline-block; animation: qz-pop .45s .9s both; }
.qz-board-row.qz-up .qz-board-place::after { content: '▲'; position: absolute; transform: translate(22px, -14px);
    color: var(--qz-ok); font-size: 14px; animation: qz-pop .4s both; }
.qz-board-place { position: relative; }
.qz-board-score { display: inline-block; font-variant-numeric: tabular-nums; }
/* Podium: each place rises on its own drum hit; the winner gets a shine sweep. */
.qz-pod-1 .qz-pod-block { position: relative; overflow: hidden; }
.qz-pod-1 .qz-pod-block::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%);
    transform: translateX(-120%); animation: qz-shine 1.4s 3.5s ease-out both; }
@keyframes qz-shine { to { transform: translateX(120%); } }
.qz-pod-1 .qz-pod-nick { animation: qz-pop .5s 3.3s both; }
@media (prefers-reduced-motion: reduce) {
    .qz-stage-bg::after { display: none; }
    .qz-stage.qz-hit .qz-stage-bg, .qz-countdown b.qz-count::after, .qz-host-board .qz-delta,
    .qz-pod-1 .qz-pod-block::after, .qz-pod-1 .qz-pod-nick, .qz-board-row.qz-up .qz-board-place::after { animation: none !important; }
    .qz-countdown b.qz-count::after { display: none; }
}
.qz-btn.qz-btn-danger { color: #c4366a !important; border-color: rgba(196, 54, 106, .45); }
.qz-btn.qz-btn-danger:hover { background: #c4366a !important; color: #fff !important; border-color: #c4366a; }
.qz-delete-form { display: inline; margin: 0; }

/* ---------- «Создать с ИИ» dialog ---------- */
.qz-ai { box-sizing: border-box; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--ui-border);
    border-radius: 16px; background: var(--ui-surface, #fff); color: var(--ui-text, #1b2430); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.qz-ai::backdrop { background: rgba(10, 14, 22, .55); }
.qz-ai-form { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; }
.qz-ai-form .qz-h2 { margin: 0 0 8px; }
.qz-ai-form .fa-magic { color: #0b7a72; }
.qz-ai-form .qz-btn .fa-magic { color: inherit; }
.qz-ai-label { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-weight: 600; font-size: 14px; }
.qz-ai-label .qz-muted { font-weight: 400; }
.qz-ai-form .qz-input { width: 100%; }
.qz-ai-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
/* The dialog lives outside .qz, so it gets the quiz colours itself (they follow the light/dark site theme). */
.qz-ai { --qz-soft: var(--ui-surface-2, #f0f3f7); --qz-bad: #c93a52; }
:root[data-theme="dark"] .qz-ai { --qz-bad: #ff8a9b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .qz-ai { --qz-bad: #ff8a9b; } }
.qz-ai-status { margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--qz-soft); color: var(--ui-text, #1b2430);
    font-weight: 600; }
.qz-ai-busy .qz-ai-status::before { content: ''; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
    border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: qz-ai-spin .8s linear infinite; }
.qz-ai-status.qz-ai-error { background: rgba(201, 58, 82, .14); color: var(--qz-bad); }
.qz-ai .qz-actions { justify-content: flex-end; }
@keyframes qz-ai-spin { to { transform: rotate(360deg); } }
@media (max-width: 520px) { .qz-ai-grid { grid-template-columns: 1fr 1fr; } .qz-ai-form { padding: 16px; } }

/* ---------- fit on any screen: long answers, old panels, landscape, big screens ---------- */
.qz-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qz-opts-long, .qz-opts-tf.qz-opts-long { grid-template-columns: minmax(0, 1fr); }
.qz-opts-tf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qz-opt { box-sizing: border-box; width: 100%; min-width: 0; height: auto; white-space: normal; overflow: visible; overflow-wrap: anywhere;
    word-break: normal; line-height: 1.25; text-overflow: clip; }
.qz-opt-text { display: block; min-width: 0; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; hyphens: auto; }
.qz-opts-show { max-height: none; }
.qz-opts-show .qz-opt { overflow: visible; }
.qz-q-head, .qz-host-q-main, .qz-q { min-width: 0; }
.qz-screen { overscroll-behavior: contain; }
@media (max-width: 480px) {
    .qz-opts:not(.qz-opts-long):not(.qz-opts-tf) .qz-opt { font-size: 15px; padding: 10px 8px; gap: 6px; }
    .qz-opts:not(.qz-opts-long) .qz-opt .qz-shape-box { width: 24px; height: 24px; font-size: 18px; }
    .qz-opts:not(.qz-opts-long) .qz-opt .qz-shape-box .qz-shape { width: 22px; height: 22px; }
    .qz-hero { padding: 14px; }
    .qz-hero .qz-h1 { font-size: 24px; }
    .qz-cards { grid-template-columns: minmax(0, 1fr); }
    .qz-lobby-join, .qz-lobby-players { padding: 14px; border-radius: 16px; }
    .qz-lobby-pin { font-size: clamp(36px, 15vw, 64px); }
}
@media (max-width: 899px) {
    .qz-opts-show { grid-auto-rows: auto; }
    .qz-host-q-main .qz-hint-big, .qz-host-q-main .qz-tiles-show { margin-top: 0; }
}
/* landscape phones and short windows */
@media (max-height: 520px) {
    .qz-topbar { min-height: 40px; padding: 2px 10px; }
    .qz-role-screen .qz-topbar { min-height: 48px; }
    .qz-screen { padding: 8px 10px 12px; }
    .qz-q { gap: 8px; max-width: 1000px; }
    .qz-q-head { padding: 8px 12px; gap: 6px; }
    .qz-q-text { font-size: 17px; }
    .qz-q-img img { max-height: 24vh; }
    .qz-answer > .qz-opts:not(.qz-opts-long):not(.qz-opts-multi) .qz-opt, .qz-opt { min-height: 52px; }
    .qz-ctl { min-height: 38px; }
    .qz-controls { padding: 4px 8px; }
    .qz-lobby-qr { min-width: 90px; width: 26vh; }
    .qz-lobby-pin { font-size: clamp(32px, 12vh, 80px); }
    .qz-join { min-height: 0; }
}
@media (max-height: 520px) and (min-width: 600px) {
    .qz-q .qz-opts:not(.qz-opts-long) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .qz-q .qz-opts-tf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* big touch panels and TV-like screens */
@media (min-width: 1600px) {
    .qz { max-width: 1400px; }
    .qz-stage.qz-role-screen { font-size: 22px; }
    .qz-role-screen .qz-controls { padding: 12px; }
    .qz-role-screen .qz-ctl { min-height: 56px; font-size: 20px; padding: 0 20px; }
    .qz-role-screen .qz-bar-title, .qz-role-screen .qz-bar-q { font-size: 26px; }
}
@media (min-width: 2400px) {
    .qz-stage.qz-role-screen { font-size: 28px; }
    .qz-host-q { max-width: 2200px; grid-template-columns: minmax(0, 1fr) 320px; }
}
.qz-ctl { box-sizing: border-box; }
/* old Android WebView: no flex gap, so give neighbours some room */
.qz-controls .qz-ctl { margin: 3px; }
.qz-topbar > * { margin-left: 4px; margin-right: 4px; }

/* volume popover */
.qz-vol { position: fixed; z-index: 3000; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
    background: var(--ui-surface, #fff); color: var(--ui-text, #1b2430); box-shadow: 0 8px 28px rgba(0, 0, 0, .35); width: 230px; max-width: calc(100vw - 16px); box-sizing: border-box; }
.qz-vol .qz-icon-btn { flex: none; }
.qz-vol-range { flex: 1; min-width: 0; height: 32px; margin: 0; padding: 0; background: none; border: 0; box-shadow: none; accent-color: #0b7a72; cursor: pointer; }

/* My quizzes on phones: actions wrap under the title instead of overflowing. */
@media (max-width: 560px) {
    .qz-myrow { flex-wrap: wrap; }
    .qz-myrow-main { flex: 1 1 calc(100% - 90px); }
}
