/* ===== quiz/categories ===== */
        .qz-main { overflow-x: hidden; }

        /* ---------- hero ---------- */
        .qz-hero {
            position: relative;
            overflow: hidden;
            padding: 16px 16px 14px;
            border-radius: 24px;
            color: #fff;
            background: linear-gradient(135deg, #29a9e1, #4b79cf 55%, #a24bcf);
            box-shadow: 0 14px 30px rgba(60, 70, 190, .32);
        }
        .qz-hero-shine { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 15% 0%, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 55%); }
        .qz-hero-img { position: absolute; right: 8px; top: 6px; width: 96px; height: 96px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .25)); }
        .qz-hero-text { position: relative; padding-right: 100px; min-height: 70px; }
        .qz-hero-title { font-size: 24px; font-weight: 800; line-height: 1.2; }
        .qz-hero-sub { margin-top: 4px; font-size: 14px; opacity: .93; line-height: 1.4; }
        .qz-hero-chips { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
        .qz-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 18px; font-size: 13px; background: rgba(255, 255, 255, .22); }
        .qz-chip .material-symbols-outlined { font-size: 18px !important; color: #ffd54f; font-variation-settings: 'FILL' 1; }

        .qz-section-title { display: flex; align-items: center; gap: 8px; margin: 18px 4px 12px; font-weight: 800; font-size: 17px; color: var(--text-dark); }
        .qz-section-title .material-symbols-outlined { color: #4b79cf; font-size: 24px !important; }

        /* ---------- "all categories" banner ---------- */
        .qz-all {
            position: relative;
            display: flex; align-items: center; gap: 14px;
            width: 100%; padding: 16px;
            border: 0; border-radius: 22px; overflow: hidden;
            text-align: left; color: #fff;
            background: linear-gradient(120deg, #ffb300, #ff7043 70%, #ff5252);
            box-shadow: 0 12px 26px rgba(255, 112, 50, .38);
            transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease;
        }
        .qz-all::after { content: ''; position: absolute; right: -40px; top: -50px; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
        .qz-all-icon {
            position: relative; flex: 0 0 56px; width: 56px; height: 56px;
            display: flex; align-items: center; justify-content: center;
            border-radius: 18px; background: rgba(255, 255, 255, .25);
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4);
        }
        .qz-all-icon .material-symbols-outlined { font-size: 32px !important; }
        .qz-all-text { position: relative; flex: 1 1 auto; min-width: 0; }
        .qz-all-title { font-size: 19px; font-weight: 800; line-height: 1.25; }
        .qz-all-sub { font-size: 13px; opacity: .95; margin-top: 2px; }
        .qz-all-go { position: relative; font-size: 28px !important; }
        .qz-all:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(255, 112, 50, .5); }
        .qz-all:active { transform: scale(.98); }

        /* ---------- category cards ---------- */
        .qz-card {
            position: relative;
            display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
            width: 100%; min-height: 156px; padding: 18px 10px 24px;
            border: 0; border-radius: 22px; overflow: hidden;
            color: var(--text-dark); background: var(--surface-1);
            box-shadow: 0 8px 20px rgba(18, 90, 160, .15);
            transition: transform .2s cubic-bezier(.2, .8, .2, 1), box-shadow .2s ease;
        }
        .qz-card::before { content: ''; position: absolute; right: -34px; top: -34px; width: 100px; height: 100px; border-radius: 50%; background: var(--c1); opacity: .14; }
        .qz-badge {
            position: relative;
            width: 60px; height: 60px;
            display: flex; align-items: center; justify-content: center;
            border-radius: 20px; color: #fff;
            background: linear-gradient(145deg, var(--c1), var(--c2));
            box-shadow: 0 8px 16px rgba(0, 0, 0, .2), inset 0 -4px 0 rgba(0, 0, 0, .15);
            transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
        }
        .qz-badge .material-symbols-outlined { font-size: 32px !important; }
        .qz-label { position: relative; font-weight: 700; line-height: 1.35; text-align: center; }
        .qz-go {
            position: absolute; right: 10px; bottom: 8px;
            display: inline-flex; align-items: center; gap: 2px;
            font-size: 12px; font-weight: 700; color: var(--c1);
        }
        .qz-go .material-symbols-outlined { font-size: 18px !important; transition: transform .2s ease; }
        .qz-card:hover { transform: translateY(-4px); box-shadow: 0 14px 26px rgba(18, 90, 160, .24); }
        .qz-card:hover .qz-badge { transform: scale(1.1) rotate(-6deg); }
        .qz-card:hover .qz-go .material-symbols-outlined { transform: translateX(3px); }
        .qz-card:active { transform: scale(.97); }

        /* ---------- loading placeholders ---------- */
        .qz-skel {
            height: 156px; border-radius: 22px;
            background: linear-gradient(100deg, rgba(255, 255, 255, .55) 30%, rgba(255, 255, 255, .95) 50%, rgba(255, 255, 255, .55) 70%);
            background-size: 220% 100%;
            box-shadow: 0 8px 20px rgba(18, 90, 160, .1);
        }
        .qz-skel-wide { height: 88px; }
        html[data-theme="dark"] .qz-skel { background-image: linear-gradient(100deg, rgba(255, 255, 255, .06) 30%, rgba(255, 255, 255, .14) 50%, rgba(255, 255, 255, .06) 70%); }
        @media (prefers-reduced-motion: no-preference) {
            .qz-skel { animation: qz-shimmer 1.4s linear infinite; }
            @keyframes qz-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
        }

        @media (min-width: 768px) {
            .qz-grid .qz-col { width: 33.3333%; }
            #qz_skel .col-6 { width: 33.3333%; }
        }

/* ===== quiz/levels ===== */
        .ql-main { overflow-x: hidden; }
        .ql-card { background: var(--surface-1); color: var(--text-dark); }
        /* ---------- hero ---------- */
        .ql-hero {
            position: relative;
            overflow: hidden;
            padding: 16px 16px 14px;
            border-radius: 24px;
            color: #fff;
            background: linear-gradient(135deg, #29a9e1, #4b79cf 55%, #a24bcf);
            box-shadow: 0 14px 30px rgba(60, 70, 190, .32);
        }
        .ql-hero-shine { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 15% 0%, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 55%); }
        .ql-hero-top { position: relative; display: flex; align-items: center; gap: 12px; padding-right: 50px; }
        .ql-hero-icon {
            flex: 0 0 52px; width: 52px; height: 52px;
            display: flex; align-items: center; justify-content: center;
            border-radius: 16px;
            background: rgba(255, 255, 255, .22);
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
        }
        .ql-hero-icon .material-symbols-outlined { font-size: 32px !important; color: #ffd54f; font-variation-settings: 'FILL' 1; }
        .ql-hero-title { font-size: 20px; font-weight: 800; line-height: 1.2; }
        .ql-hero-sub { font-size: 13px; opacity: .92; line-height: 1.35; margin-top: 2px; }
        .ql-hero-bar { position: relative; height: 12px; margin-top: 14px; border-radius: 8px; background: rgba(255, 255, 255, .25); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .2); overflow: hidden; }
        .ql-hero-fill { height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, #ffe082, #ff9800); transition: width 1.2s cubic-bezier(.2, .8, .2, 1) .3s; }
        .ql-hero-chips { position: relative; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
        .ql-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 18px; font-size: 13px; background: rgba(255, 255, 255, .22); }
        .ql-chip .material-symbols-outlined { font-size: 18px !important; font-variation-settings: 'FILL' 1; color: #ffd54f; }
        .ql-chip-streak { background: linear-gradient(120deg, #ff9800, #ff5722); }
        .ql-chip-streak .material-symbols-outlined { color: #fff; }

        /* ---------- level path ---------- */
        .ql-path { position: relative; margin-top: 18px; }
        .ql-svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
        .ql-seg { fill: none; stroke-width: 7; stroke-linecap: round; stroke: rgba(75, 121, 207, .5); stroke-dasharray: 1 14; }
        html[data-theme="dark"] .ql-seg { stroke: rgba(255, 255, 255, .38); }
        .ql-seg.done { stroke: url(#ql_grad); stroke-dasharray: none; stroke-width: 8; }
        .ql-svg.static .ql-seg.done { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
        .ql-nodes { position: relative; }
        .ql-node { position: relative; height: 128px; }
        .ql-node-in {
            position: absolute;
            top: 0;
            left: calc(50% + (var(--x, 0) * 1%));
            width: 150px; margin-left: -75px;
            display: flex; flex-direction: column; align-items: center;
        }
        .ql-btn {
            position: relative;
            display: flex; align-items: center; justify-content: center;
            width: 78px; height: 78px;
            border: 5px solid #fff;
            border-radius: 50%;
            color: #fff;
            font-size: 30px; font-weight: 800; line-height: 1;
            box-shadow: 0 8px 18px rgba(0, 0, 0, .25), inset 0 -5px 0 rgba(0, 0, 0, .18);
            transition: transform .15s ease, filter .2s ease;
        }
        .ql-btn.done   { background: linear-gradient(145deg, #3ccf7f, #198754); }
        .ql-btn.now    { background: linear-gradient(145deg, #29a9e1, #4b79cf); width: 88px; height: 88px; font-size: 34px; }
        .ql-btn.locked { background: linear-gradient(145deg, #aab6c1, #78909c); cursor: not-allowed; }
        .ql-btn:not(.locked):hover { filter: brightness(1.08); transform: scale(1.06); }
        .ql-btn:not(.locked):active { transform: scale(.94); }
        .ql-lockic { position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #455a64; border: 3px solid #fff; font-size: 16px !important; }
        .ql-check { position: absolute; right: -4px; bottom: -4px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #ffc107; color: #fff; border: 3px solid #fff; font-size: 18px !important; font-weight: 800; }
        .ql-bubble {
            position: absolute; top: -34px;
            padding: 3px 12px; border-radius: 14px;
            font-size: 13px; font-weight: 800; color: #fff; white-space: nowrap;
            background: linear-gradient(120deg, #ff9800, #ff5722);
            box-shadow: 0 5px 12px rgba(255, 100, 30, .4);
        }
        .ql-bubble::after { content: ''; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: #ff5722; }
        .ql-stars { display: flex; gap: 1px; margin-top: 8px; }
        .ql-star { font-size: 18px !important; color: #cfd8e0; font-variation-settings: 'FILL' 1; }
        .ql-star.on { color: #ffb300; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
        .ql-stars.dim .ql-star { visibility: hidden; }
        .ql-cap { margin-top: 2px; padding: 1px 9px; border-radius: 10px; font-size: 12px; text-align: center; color: var(--text-dark); white-space: nowrap; background: rgba(255, 255, 255, .6); }
        html[data-theme="dark"] .ql-cap { background: rgba(255, 255, 255, .1); }

        /* ---------- folded rules ---------- */
        .ql-acc-btn {
            display: flex; align-items: center; gap: 8px;
            width: 100%; margin-top: 10px; padding: 12px 14px;
            border: 0; border-radius: 16px;
            font-weight: 700; text-align: left;
            color: var(--text-dark); background: var(--surface-1);
            box-shadow: 0 6px 16px rgba(18, 90, 160, .12);
        }
        .ql-acc-btn > span:nth-child(2) { flex: 1 1 auto; }
        .ql-acc-btn .material-symbols-outlined { color: #29a9e1; }
        .ql-rules-modal .modal-header { color: #fff; border-bottom: 0; background: linear-gradient(120deg, #29a9e1, #4b79cf 60%, #a24bcf); }
        .ql-rules-modal .modal-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; }
        .ql-rules-modal .ql-rules > div { padding: 8px 10px; border-radius: 12px; background: var(--surface-3, #eef5fb); color: var(--text-dark); }
        .ql-rules-modal .ql-rules > div + div { margin-top: 8px; }
        .ql-rules-sub { display: flex; align-items: center; gap: 6px; margin: 18px 0 8px; font-weight: 800; color: var(--text-dark); }
        .ql-rules-sub .material-symbols-outlined { color: #ffb300; font-variation-settings: 'FILL' 1; }
        .ql-rules-tablewrap { overflow: hidden; border-radius: 14px; box-shadow: 0 4px 12px rgba(18, 90, 160, .12); }
        .ql-rules-tablewrap table { margin: 0; text-align: center; --bs-table-bg: transparent; color: var(--text-dark); }
        .ql-rules-tablewrap thead th { color: #fff; background: linear-gradient(120deg, #29a9e1, #4b79cf); border: 0; }

        /* settings gear (inside the hero) */
        .ql-gear {
            position: absolute; top: 12px; right: 12px; z-index: 2;
            display: flex; align-items: center; justify-content: center;
            width: 42px; height: 42px;
            border: 3px solid #fff; border-radius: 50%;
            color: #fff;
            background: linear-gradient(145deg, #4b79cf, #a24bcf);
            box-shadow: 0 5px 12px rgba(40, 30, 140, .45), inset 0 -3px 0 rgba(0, 0, 0, .18);
            transition: transform .15s ease;
        }
        .ql-gear:active { transform: scale(.9); }
        .ql-gear .material-symbols-outlined { font-size: 25px !important; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
        .ql-gear:hover .material-symbols-outlined { transform: rotate(90deg); }

        @media (prefers-reduced-motion: no-preference) {
            .ql-btn.now { animation: ql-pulse 1.8s ease-in-out infinite; }
            .ql-bubble { animation: ql-bob 1.2s ease-in-out infinite; }
            .ql-seg.done { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: ql-draw 1s ease-out .5s forwards; }
            @keyframes ql-pulse {
                0%, 100% { box-shadow: 0 8px 18px rgba(0, 0, 0, .25), inset 0 -5px 0 rgba(0, 0, 0, .18), 0 0 0 0 rgba(41, 169, 225, .55); }
                50%      { box-shadow: 0 8px 18px rgba(0, 0, 0, .25), inset 0 -5px 0 rgba(0, 0, 0, .18), 0 0 0 14px rgba(41, 169, 225, 0); }
            }
            @keyframes ql-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
            @keyframes ql-draw { to { stroke-dashoffset: 0; } }
        }
        .ql-rules > div { display: flex; gap: 8px; line-height: 1.4; margin-bottom: 10px; }
        .ql-rules > div:last-child { margin-bottom: 0; }
        .ql-rules .material-symbols-outlined { color: #2196f3; flex: 0 0 auto; font-size: 24px; }
        .ql-start-img { width: 100%; max-width: 280px; height: auto; }
        .ql-start-title { color: #2aa3dc; font-weight: 400; margin: 16px 0 14px; }
        .ql-start-info { color: #2aa3dc; font-size: 17px; }
        .ql-start-btn { min-width: 130px; background: #1a98e8; border-color: #1a98e8; box-shadow: 0 2px 5px rgba(0,0,0,.2); }
        .ql-table { --bs-table-bg: transparent; color: var(--text-dark); }

        /* ---------- game-style settings (same look as the play page panel) ---------- */
        .ql-settings .modal-title { display: flex; align-items: center; gap: 8px; font-weight: 800; }
        .ql-settings .modal-title .material-symbols-outlined { color: #a24bcf; }
        .qs-hint { margin-top: 10px; text-align: center; font-size: 12px; color: var(--text-light); }

        .qs-host { text-align: left; }
        .qs-in-start { margin: 18px 0 20px; }
        .qs-block {
            padding: 12px 14px 14px;
            border-radius: 20px;
            color: #fff;
            background: linear-gradient(160deg, #1d2b64, #3a2a7a 60%, #5b2a86);
            border: 3px solid rgba(255, 255, 255, .85);
            box-shadow: 0 12px 28px rgba(20, 20, 70, .4), inset 0 0 0 2px rgba(255, 255, 255, .08);
        }
        .qs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 14px; background: rgba(255, 255, 255, .1); }
        .qs-row + .qs-row { margin-top: 8px; }
        .qs-row.qs-vol { flex-direction: column; align-items: stretch; gap: 8px; }
        .qs-row[hidden] { display: none; }
        .qs-label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
        .qs-label .material-symbols-outlined { color: #4bc5cf; font-size: 24px !important; font-variation-settings: 'FILL' 1; }
        .qs-label small { display: block; font-size: 11px; font-weight: 500; opacity: .75; }
        .qs-switch {
            position: relative; flex: 0 0 auto;
            width: 84px; height: 38px;
            border: 0; border-radius: 20px;
            background: linear-gradient(120deg, #2fb36f, #198754);
            box-shadow: inset 0 3px 6px rgba(0, 0, 0, .3), 0 2px 0 rgba(255, 255, 255, .25);
            transition: background .25s ease;
        }
        .qs-switch[aria-checked="false"] { background: linear-gradient(120deg, #78909c, #546e7a); }
        .qs-switch-text { position: absolute; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 800; letter-spacing: .06em; color: #fff; }
        .qs-on { left: 12px; }
        .qs-off { right: 10px; }
        .qs-switch[aria-checked="true"] .qs-off, .qs-switch[aria-checked="false"] .qs-on { display: none; }
        .qs-knob {
            position: absolute; top: 3px; left: 3px;
            width: 32px; height: 32px; border-radius: 50%;
            background: linear-gradient(145deg, #fff, #dfe6ee);
            box-shadow: 0 3px 6px rgba(0, 0, 0, .35);
            transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
        }
        .qs-switch[aria-checked="true"] .qs-knob { transform: translateX(46px); }
        .qs-vol-wrap { display: flex; align-items: center; gap: 8px; }
        .qs-vol-end { font-size: 20px !important; color: rgba(255, 255, 255, .75); flex: 0 0 auto; }
        .qs-vol-num { flex: 0 0 44px; text-align: right; font-size: 14px; color: #ffd54f; font-variant-numeric: tabular-nums; }
        .qs-volume {
            -webkit-appearance: none; appearance: none;
            flex: 1 1 auto; min-width: 0; height: 16px; border-radius: 10px; cursor: pointer;
            background: linear-gradient(90deg, #ffd54f 0%, #ff9800 var(--v, 80%), rgba(0, 0, 0, .35) var(--v, 80%));
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4);
        }
        .qs-volume::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; border-radius: 50%; border: 3px solid #fff; background: linear-gradient(145deg, #ffb300, #ff6d00); box-shadow: 0 3px 8px rgba(0, 0, 0, .45); }
        .qs-volume::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; background: linear-gradient(145deg, #ffb300, #ff6d00); box-shadow: 0 3px 8px rgba(0, 0, 0, .45); }
        .qs-volume:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(1); }

/* ===== quiz/play ===== */
        .qp-main { overflow-x: hidden; background: linear-gradient(180deg, rgba(41, 169, 225, .16) 0, rgba(41, 169, 225, 0) 280px), var(--light-bg); }
        .qp-time { min-width: 34px; font-size: 18px; color: var(--text-dark); }
        .qp-progress { height: 20px; border-radius: 10px; }
        .qp-progress .progress-bar { background: #29a9e1; transition: width 1s linear; }
        .qp-skip { color: var(--text-dark); line-height: 1; }
        .qp-card { background: var(--surface-1); color: var(--text-dark); }
        .qp-result-table { --bs-table-bg: transparent; color: var(--text-dark); }
        .qp-orange { background: #ff9800; border-color: #ff9800; }

        /* ---------- question card ---------- */
        .qp-mcq {
            margin: 8px 0;
            border-radius: 22px;
            overflow: hidden;
            background: var(--surface-1);
            color: var(--text-dark);
            box-shadow: 0 10px 28px rgba(18, 90, 160, .16);
        }
        .qp-qhead {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 11px 16px;
            color: #fff;
            background: linear-gradient(120deg, #29a9e1, #4b79cf 60%, #a24bcf);
        }
        .qp-qnum { font-weight: 700; font-size: 14px; letter-spacing: .02em; }
        .qp-qicon { font-size: 24px !important; opacity: .9; }
        .qp-qbody { padding: 16px 16px 4px; }
        .qp-question { font-size: 18px; font-weight: 700; line-height: 1.5; margin: 0 0 12px; color: var(--text-dark); }
        .qp-mcq p img { max-width: 100%; border-radius: 12px; }

        /* ---------- options: a coloured letter badge, big tap area, a mark once answered ---------- */
        .qp-opts { display: flex; flex-direction: column; gap: 10px; padding: 4px 14px 14px; font-size: 16px; }
        .qp-option {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border: 2px solid var(--border-color, #e0e0e0);
            border-radius: 16px;
            background: var(--surface-1);
            color: var(--text-dark);
            cursor: pointer;
        }
        .qp-letter {
            flex: 0 0 36px;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            font-weight: 800;
            color: #fff;
            background: var(--ql, #29a9e1);
            box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
        }
        .qp-option[data-opt="1"] { --ql: #29a9e1; }
        .qp-option[data-opt="2"] { --ql: #a24bcf; }
        .qp-option[data-opt="3"] { --ql: #ff9800; }
        .qp-option[data-opt="4"] { --ql: #1e9c8c; }
        .qp-option[data-opt="5"] { --ql: #e52262; }
        .qp-opt-text { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
        .qp-mark { display: none; flex: 0 0 auto; font-size: 28px !important; font-variation-settings: 'FILL' 1; }
        .qp-option.green .qp-mark, .qp-option.red .qp-mark, .qp-option.yellow .qp-mark { display: block; }
        .qp-option.locked { cursor: default; }
        .qp-option.green  { background: linear-gradient(120deg, #198754, #2fb36f); border-color: #198754; color: #fff; }
        .qp-option.red    { background: linear-gradient(120deg, #dc3545, #ff6b6b); border-color: #dc3545; color: #fff; }
        .qp-option.yellow { background: linear-gradient(120deg, #ffc107, #ffd54f); border-color: #ffc107; color: #000; }
        .qp-option.green .qp-letter, .qp-option.red .qp-letter, .qp-option.yellow .qp-letter { background: rgba(255, 255, 255, .28); box-shadow: none; }
        .qp-option img, .qp-exp img { display: block; max-width: 100%; border-radius: 10px; }
        .qp-exp {
            display: none;
            margin: 0 14px 14px;
            padding: 12px 14px;
            border-left: 4px solid #198754;
            border-radius: 12px;
            background: rgba(25, 135, 84, .12);
            font-size: 14px;
            color: var(--text-dark);
        }
        .qp-exp.show { display: block; }

        /* ---------- score / streak chips and the pop-up message ---------- */
        .qp-stats { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
        .qp-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 3px 12px 3px 8px;
            border-radius: 20px;
            font-weight: 700;
            font-size: 14px;
            color: var(--text-dark);
            background: var(--surface-1);
            box-shadow: 0 3px 8px rgba(0, 0, 0, .1);
        }
        .qp-chip .material-symbols-outlined { font-size: 20px !important; font-variation-settings: 'FILL' 1; }
        .qp-score .material-symbols-outlined { color: #ffb300; }
        .qp-streak { color: #fff; background: linear-gradient(120deg, #ff9800, #ff5722); }
        .qp-streak .material-symbols-outlined { color: #fff; }
        .qp-toast {
            position: fixed;
            left: 50%;
            bottom: calc(76px + env(safe-area-inset-bottom, 0px));   /* above the bottom nav / screen edge */
            z-index: 1058;
            padding: 10px 22px;
            border-radius: 26px;
            font-size: 20px;
            font-weight: 800;
            color: #fff;
            white-space: nowrap;
            pointer-events: none;
            opacity: 0;
            transform: translate(-50%, 24px) scale(.8);
            transition: opacity .25s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
            box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
        }
        .qp-toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
        .qp-toast.good { background: linear-gradient(120deg, #198754, #2fb36f); }
        .qp-toast.bad  { background: linear-gradient(120deg, #dc3545, #ff6b6b); }
        .qp-toast.late { background: linear-gradient(120deg, #ff9800, #ffb300); }

        /* ---------- wow: timer colour, heartbeat, progress dots, option entrance, burst, result ---------- */
        .qp-progress .progress-bar { transition: width 1s linear, background-color .5s ease; }
        .qp-progress .progress-bar[data-state="ok"]     { background: linear-gradient(90deg, #29a9e1, #4bc5cf); }
        .qp-progress .progress-bar[data-state="warn"]   { background: linear-gradient(90deg, #ffb300, #ff9800); }
        .qp-progress .progress-bar[data-state="danger"] { background: linear-gradient(90deg, #ff5252, #dc3545); }
        .qp-time { text-align: center; font-variant-numeric: tabular-nums; }
        .qp-time.urgent { color: #dc3545; font-weight: 700; }

        .qp-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
        .qp-dot { width: 9px; height: 9px; border-radius: 50%; background: #c5d0da; transition: background-color .3s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1); }
        .qp-dot.now { background: #29a9e1; transform: scale(1.5); }
        .qp-dot.c { background: #198754; }
        .qp-dot.w { background: #dc3545; }
        .qp-dot.s { background: #ffc107; }

        .qp-burst-bit {
            position: fixed;
            z-index: 1060;
            width: 8px; height: 8px;
            border-radius: 2px;
            pointer-events: none;
        }

        @media (prefers-reduced-motion: no-preference) {
            .qp-time.beat #timer { display: inline-block; animation: qp-beat .45s ease; }
            .qp-time.urgent.beat #timer { animation: qp-beat-urgent .45s ease; }
            .qp-progress.urgent { animation: qp-bar-pulse .8s ease-in-out infinite; }

            /* options slide in one after another when a question appears */
            .qp-mcq .qp-option { animation: qp-opt-in .45s cubic-bezier(.2, .8, .2, 1) backwards; transition: transform .15s ease, background-color .2s ease, border-color .2s ease; }
            .qp-mcq .qp-option:nth-child(1) { animation-delay: .10s; }
            .qp-mcq .qp-option:nth-child(2) { animation-delay: .18s; }
            .qp-mcq .qp-option:nth-child(3) { animation-delay: .26s; }
            .qp-mcq .qp-option:nth-child(4) { animation-delay: .34s; }
            .qp-mcq .qp-option:nth-child(5) { animation-delay: .42s; }
            .qp-option:not(.locked):hover { transform: translateX(4px); border-color: #29a9e1; }
            .qp-option:not(.locked):active { transform: scale(.98); }
            .qp-option.red { animation: qp-wrong .5s ease; }
            .qp-mcq .qp-option.green.animate__pulse, .qp-mcq .qp-option.yellow.animate__pulse { animation: qp-right-pop .7s cubic-bezier(.34, 1.56, .64, 1); }
            .qp-mcq.shake { animation: qp-card-shake .5s ease; }


            .qp-burst-bit { animation: qp-burst .9s cubic-bezier(.15, .7, .3, 1) forwards; }
            .qp-chip.pop { animation: qp-pop .5s cubic-bezier(.34, 1.56, .64, 1); }
            .qp-streak .material-symbols-outlined { animation: qp-flame 1s ease-in-out infinite; }

            @keyframes qp-beat         { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }
            @keyframes qp-beat-urgent  { 0% { transform: scale(1); } 35% { transform: scale(1.6); } 100% { transform: scale(1); } }
            @keyframes qp-bar-pulse    { 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, .5); } 50% { box-shadow: 0 0 0 6px rgba(220, 53, 69, 0); } }
            @keyframes qp-opt-in       { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: none; } }
            @keyframes qp-right-pop    { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
            @keyframes qp-wrong        { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
            @keyframes qp-card-shake   { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-9px); } 30% { transform: translateX(8px); } 45% { transform: translateX(-6px); } 60% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
            @keyframes qp-flame        { 0%, 100% { transform: scale(1) rotate(-4deg); } 50% { transform: scale(1.2) rotate(5deg); } }
            @keyframes qp-pop          { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
            @keyframes qp-burst {
                0%   { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); }
                100% { opacity: 0; transform: translate(var(--bx), var(--by)) rotate(var(--br)) scale(.4); }
            }
        }

        /* ---------- result ---------- */
        .qr-hero {
            position: relative;
            overflow: hidden;
            padding: 22px 18px 24px;
            border-radius: 26px;
            text-align: center;
            color: #fff;
            background: linear-gradient(135deg, #198754, #2fb36f 55%, #4bc5cf);
            box-shadow: 0 14px 32px rgba(25, 135, 84, .35);
        }
        #rc[data-state="fail"]  .qr-hero { background: linear-gradient(135deg, #ff9800, #ff6a3d 55%, #ff5252); box-shadow: 0 14px 32px rgba(255, 106, 61, .35); }
        #rc[data-state="error"] .qr-hero { background: linear-gradient(135deg, #607d8b, #78909c 55%, #90a4ae); box-shadow: 0 14px 32px rgba(96, 125, 139, .35); }
        .qr-shine { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 55%); }
        .qr-level {
            position: relative;
            display: inline-block;
            padding: 3px 14px;
            border-radius: 20px;
            font-weight: 700;
            font-size: 13px;
            background: rgba(255, 255, 255, .22);
        }
        .qr-ring { position: relative; width: 150px; height: 150px; margin: 14px auto 6px; }
        .qr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
        .qr-ring circle { fill: none; stroke-width: 10; }
        .qr-ring-bg { stroke: rgba(255, 255, 255, .25); }
        .qr-ring-fg { stroke: #fff; stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 326.73; transition: stroke-dashoffset 1.4s cubic-bezier(.2, .8, .2, 1) .3s; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .6)); }
        .qr-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 38px; line-height: 1; }
        .qr-ring-text small { font-size: 18px; margin-left: 2px; opacity: .9; }
        .qr-stars { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
        .qr-star { font-size: 38px !important; color: rgba(255, 255, 255, .35); font-variation-settings: 'FILL' 1; transition: color .3s ease, transform .5s cubic-bezier(.34, 1.56, .64, 1); }
        .qr-star.on { color: #ffd54f; transform: scale(1.15); filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .3)); }
        .qr-title { position: relative; font-size: 26px; font-weight: 800; margin: 4px 0 4px; }
        .qr-msg { position: relative; font-size: 15px; opacity: .95; line-height: 1.4; }
        .qr-score { position: relative; margin-top: 10px; font-size: 16px; }
        .qr-score b { font-size: 24px; }
        .qr-points {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            margin-top: 12px;
            padding: 6px 16px;
            border-radius: 22px;
            font-weight: 800;
            color: #7a5200;
            background: linear-gradient(120deg, #ffe082, #ffca28);
            box-shadow: 0 6px 14px rgba(0, 0, 0, .22);
        }
        .qr-points .material-symbols-outlined { font-size: 22px !important; font-variation-settings: 'FILL' 1; }

        .qr-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
        @media (min-width: 576px) { .qr-tiles { grid-template-columns: repeat(4, 1fr); } }
        .qr-tile {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            padding: 12px 8px;
            border-radius: 18px;
            color: var(--text-dark);
            background: var(--surface-1);
            box-shadow: 0 6px 16px rgba(18, 90, 160, .12);
            border-bottom: 4px solid var(--qt, #29a9e1);
        }
        .qr-tile .material-symbols-outlined { font-size: 28px !important; color: var(--qt, #29a9e1); font-variation-settings: 'FILL' 1; }
        .qr-tile b { font-size: 26px; line-height: 1.1; }
        .qr-tile small { font-size: 12px; opacity: .75; text-align: center; }
        .qr-correct { --qt: #198754; }
        .qr-wrong { --qt: #dc3545; }
        .qr-skip { --qt: #f0ad00; }
        .qr-answered { --qt: #29a9e1; }

        .qr-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
        .qr-actions-row { display: flex; gap: 10px; }
        .qr-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
            padding: 13px 16px;
            border: 0;
            border-radius: 16px;
            font-weight: 700;
            font-size: 16px;
        }
        .qr-btn .material-symbols-outlined { font-size: 22px !important; }
        .qr-btn-main { color: #fff; background: linear-gradient(120deg, #ff9800, #ff5722); box-shadow: 0 10px 22px rgba(255, 112, 30, .4); }
        .qr-btn-sub { color: var(--text-dark); background: var(--surface-1); border: 2px solid var(--border-color, #e0e0e0); }
        .qr-btn-sub:hover { border-color: #29a9e1; }

        @media (prefers-reduced-motion: no-preference) {
            .qr-hero { animation: qp-pop .6s cubic-bezier(.34, 1.56, .64, 1) backwards; }
            #rc[data-state="pass"] .qr-title { animation: qp-pop .7s cubic-bezier(.34, 1.56, .64, 1) .5s backwards; }
            #rc[data-state="fail"] .qr-title { animation: qp-card-shake .6s ease .5s backwards; }
            .qr-tile { animation: qp-pop .5s cubic-bezier(.34, 1.56, .64, 1) backwards; }
            .qr-tile:nth-child(1) { animation-delay: .35s; }
            .qr-tile:nth-child(2) { animation-delay: .45s; }
            .qr-tile:nth-child(3) { animation-delay: .55s; }
            .qr-tile:nth-child(4) { animation-delay: .65s; }
            .qr-actions > * { animation: qp-opt-in .5s cubic-bezier(.2, .8, .2, 1) .8s backwards; }
            .qr-points { animation: qp-pop .6s cubic-bezier(.34, 1.56, .64, 1) 1.2s backwards; }
            #rc[data-state="pass"] .qr-btn-main { animation: qp-opt-in .5s cubic-bezier(.2, .8, .2, 1) .8s backwards, qr-glow 2s ease-in-out 1.5s infinite; }
            @keyframes qr-glow { 0%, 100% { box-shadow: 0 10px 22px rgba(255, 112, 30, .4); } 50% { box-shadow: 0 10px 30px rgba(255, 112, 30, .75); } }
        }

        /* ---------- game-style settings: gear + sound panel ---------- */
        .qp-tc { position: relative; }
        .qp-gear {
            position: absolute;
            right: 2px;
            bottom: -2px;
            z-index: 21;
            display: flex; align-items: center; justify-content: center;
            width: 40px; height: 40px;
            border: 3px solid #fff;
            border-radius: 50%;
            color: #fff;
            background: linear-gradient(145deg, #4b79cf, #a24bcf);
            box-shadow: 0 5px 12px rgba(75, 60, 170, .45), inset 0 -3px 0 rgba(0, 0, 0, .18);
            transition: transform .15s ease;
        }
        .qp-gear:active { transform: scale(.9); }
        .qp-gear .material-symbols-outlined { font-size: 24px !important; transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
        .qp-gear[aria-expanded="true"] .material-symbols-outlined { transform: rotate(180deg); }
        .qp-gear.muted::after {
            content: '';
            position: absolute;
            right: -2px; top: -2px;
            width: 14px; height: 14px;
            border-radius: 50%;
            border: 2px solid #fff;
            background: #dc3545;
        }

        .qp-panel {
            position: absolute;
            right: 0;
            top: calc(100% + 8px);
            z-index: 22;
            width: min(290px, calc(100vw - 24px));
            padding: 14px 16px 16px;
            border-radius: 22px;
            color: #fff;
            background: linear-gradient(160deg, #1d2b64, #3a2a7a 60%, #5b2a86);
            border: 3px solid rgba(255, 255, 255, .85);
            box-shadow: 0 16px 36px rgba(20, 20, 70, .5), inset 0 0 0 2px rgba(255, 255, 255, .08);
            transform-origin: 90% 0;
        }
        .qp-panel[hidden] { display: none; }
        .qp-panel-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 800; font-size: 17px; letter-spacing: .02em; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
        .qp-panel-title .material-symbols-outlined { color: #ffd54f; font-size: 24px !important; }
        .qp-panel-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .1); }
        .qp-panel-row + .qp-panel-row { margin-top: 10px; }
        .qp-panel-vol { flex-direction: column; align-items: stretch; gap: 8px; }
        .qp-panel-label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
        .qp-panel-label .material-symbols-outlined { color: #4bc5cf; font-size: 24px !important; font-variation-settings: 'FILL' 1; }

        /* big ON / OFF switch */
        .qp-switch {
            position: relative;
            flex: 0 0 auto;
            width: 84px; height: 38px;
            border: 0; border-radius: 20px;
            background: linear-gradient(120deg, #2fb36f, #198754);
            box-shadow: inset 0 3px 6px rgba(0, 0, 0, .3), 0 2px 0 rgba(255, 255, 255, .25);
            transition: background .25s ease;
        }
        .qp-switch[aria-checked="false"] { background: linear-gradient(120deg, #78909c, #546e7a); }
        .qp-switch-text { position: absolute; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 800; letter-spacing: .06em; }
        .qp-on { left: 12px; }
        .qp-off { right: 10px; }
        .qp-switch[aria-checked="true"] .qp-off, .qp-switch[aria-checked="false"] .qp-on { display: none; }
        .qp-switch-knob {
            position: absolute;
            top: 3px; left: 3px;
            width: 32px; height: 32px;
            border-radius: 50%;
            background: linear-gradient(145deg, #fff, #dfe6ee);
            box-shadow: 0 3px 6px rgba(0, 0, 0, .35);
            transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
        }
        .qp-switch[aria-checked="true"] .qp-switch-knob { transform: translateX(46px); }

        /* chunky volume slider: the filled part follows --v */
        .qp-vol-wrap { display: flex; align-items: center; gap: 8px; }
        .qp-vol-end { font-size: 20px !important; color: rgba(255, 255, 255, .75); flex: 0 0 auto; }
        .qp-vol-num { flex: 0 0 44px; text-align: right; font-size: 14px; color: #ffd54f; font-variant-numeric: tabular-nums; }
        .qp-volume {
            -webkit-appearance: none; appearance: none;
            flex: 1 1 auto; min-width: 0; height: 16px;
            border-radius: 10px;
            cursor: pointer;
            background: linear-gradient(90deg, #ffd54f 0%, #ff9800 var(--v, 80%), rgba(0, 0, 0, .35) var(--v, 80%));
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, .4);
        }
        .qp-volume::-webkit-slider-thumb {
            -webkit-appearance: none; appearance: none;
            width: 28px; height: 28px;
            border-radius: 50%;
            border: 3px solid #fff;
            background: linear-gradient(145deg, #ffb300, #ff6d00);
            box-shadow: 0 3px 8px rgba(0, 0, 0, .45);
        }
        .qp-volume::-moz-range-thumb {
            width: 22px; height: 22px;
            border-radius: 50%;
            border: 3px solid #fff;
            background: linear-gradient(145deg, #ffb300, #ff6d00);
            box-shadow: 0 3px 8px rgba(0, 0, 0, .45);
        }
        .qp-volume:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(1); }

        /* the question is frozen while the settings are open */
        .qp-paused #qc { filter: blur(7px); pointer-events: none; user-select: none; transition: filter .25s ease; }
        .qp-paused #skip_btn { pointer-events: none; opacity: .4; }
        .qp-paused .qp-time::after { content: ' ⏸'; font-size: 14px; }

        @media (prefers-reduced-motion: no-preference) {
            .qp-gear:hover .material-symbols-outlined { transform: rotate(90deg); }
            .qp-gear[aria-expanded="true"]:hover .material-symbols-outlined { transform: rotate(270deg); }
            .qp-panel:not([hidden]) { animation: qp-panel-in .35s cubic-bezier(.34, 1.56, .64, 1); }
            @keyframes qp-panel-in { from { opacity: 0; transform: scale(.7) translateY(-10px); } to { opacity: 1; transform: none; } }
        }

        /* ---------- lifelines, bonus / hearts chips, keyboard hint ---------- */
        .qp-lifelines { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
        .qp-life {
            position: relative;
            display: inline-flex; align-items: center; gap: 6px;
            padding: 6px 14px 6px 10px;
            border: 2px solid #fff;
            border-radius: 22px;
            font-size: 14px; color: #fff;
            background: linear-gradient(145deg, #8a5cf6, #2b1de0);
            box-shadow: 0 5px 12px rgba(60, 40, 200, .35), inset 0 -3px 0 rgba(0, 0, 0, .18);
            transition: transform .15s ease, filter .2s ease, opacity .2s ease;
        }
        .qp-life + .qp-life { background: linear-gradient(145deg, #ff9800, #ff5722); box-shadow: 0 5px 12px rgba(255, 100, 30, .35), inset 0 -3px 0 rgba(0, 0, 0, .18); }
        .qp-life .material-symbols-outlined { font-size: 20px !important; }
        .qp-life i {
            position: absolute; top: -8px; right: -6px;
            min-width: 20px; height: 20px; padding: 0 4px;
            border-radius: 10px;
            font-style: normal; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center;
            color: #333; background: #ffd54f; box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
        }
        .qp-life:not(:disabled):active { transform: scale(.92); }
        .qp-life:disabled { filter: grayscale(1); opacity: .45; cursor: not-allowed; }
        .qp-keys { display: none; margin-top: 8px; text-align: center; font-size: 12px; color: var(--text-light); }
        @media (hover: hover) and (pointer: fine) { .qp-keys { display: block; } }

        .qp-bonus { color: #7a5200; background: linear-gradient(120deg, #ffe082, #ffca28); }
        .qp-bonus .material-symbols-outlined { color: #e65100; }
        .qp-hearts { gap: 2px; padding: 3px 10px; }
        .qp-hearts .material-symbols-outlined { color: #ff5252; font-size: 20px !important; transition: transform .3s ease, color .3s ease; }
        .qp-hearts .lost { color: #b8c2cc; transform: scale(.8); }
        .qp-panel-label small { display: block; font-size: 11px; font-weight: 500; opacity: .75; }

        .qp-option.eliminated { opacity: .28; pointer-events: none; text-decoration: line-through; }
        .qp-float {
            position: fixed; z-index: 1060; pointer-events: none;
            font-size: 20px; font-weight: 800; color: #ffb300;
            text-shadow: 0 2px 4px rgba(0, 0, 0, .35);
            transform: translate(-50%, -50%);
        }
        .qp-toast.badge { background: linear-gradient(120deg, #8a5cf6, #2b1de0); }

        /* bookmark / report, shown once the answer is revealed */
        .qp-tools { display: none; gap: 10px; padding: 0 14px 14px; }
        .qp-mcq.revealed .qp-tools { display: flex; }
        .qp-tool {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 6px 14px; border: 1px solid var(--border-color, #e0e0e0); border-radius: 18px;
            font-size: 13px; color: var(--text-dark); background: var(--surface-1);
        }
        .qp-tool .material-symbols-outlined { font-size: 18px !important; }
        .qp-tool.on .material-symbols-outlined { color: #dc3545; font-variation-settings: 'FILL' 1; }

        /* result extras */
        .qr-chips { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
        .qr-chip {
            display: inline-flex; align-items: center; gap: 5px;
            padding: 5px 12px; border-radius: 18px;
            font-size: 13px; font-weight: 700;
            background: rgba(255, 255, 255, .22);
        }
        .qr-chip .material-symbols-outlined { font-size: 18px !important; font-variation-settings: 'FILL' 1; }
        .qr-chip.record { background: linear-gradient(120deg, #ffe082, #ffca28); color: #7a5200; }
        .qr-chip.badge { background: linear-gradient(120deg, #8a5cf6, #2b1de0); color: #fff; }
        .qr-btn-review { color: #b25e00; border-color: #ffb300; }

        @media (prefers-reduced-motion: no-preference) {
            .qp-float { animation: qp-float-up .95s ease-out forwards; }
            .qp-option.eliminated { transition: opacity .35s ease; }
            .qr-chip { animation: qp-pop .5s cubic-bezier(.34, 1.56, .64, 1) 1.1s backwards; }
            @keyframes qp-float-up { from { opacity: 1; transform: translate(-50%, -50%) scale(.8); } to { opacity: 0; transform: translate(-50%, -150%) scale(1.3); } }
        }

        /* ---------- info button and the rules dialog ---------- */
        .qp-info {
            position: absolute;
            left: 2px;
            bottom: -2px;
            z-index: 21;
            display: flex; align-items: center; justify-content: center;
            width: 40px; height: 40px;
            border: 3px solid #fff;
            border-radius: 50%;
            color: #fff;
            background: linear-gradient(145deg, #29a9e1, #1e9c8c);
            box-shadow: 0 5px 12px rgba(30, 130, 150, .45), inset 0 -3px 0 rgba(0, 0, 0, .18);
            transition: transform .15s ease;
        }
        .qp-info:active { transform: scale(.9); }
        .qp-info .material-symbols-outlined { font-size: 24px !important; font-variation-settings: 'FILL' 1; }

        .qp-rules .modal-header { color: #fff; background: linear-gradient(120deg, #29a9e1, #4b79cf 60%, #a24bcf); border-bottom: 0; }
        .qp-rules .modal-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; }
        .qp-rules-note { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 8px 12px; border-radius: 12px; font-size: 13px; background: rgba(41, 169, 225, .14); color: var(--text-dark); }
        .qp-rules-note .material-symbols-outlined { color: #29a9e1; font-size: 22px !important; }
        .qp-rule { display: flex; gap: 12px; margin-bottom: 14px; line-height: 1.55; color: var(--text-dark); }
        .qp-rule > .material-symbols-outlined {
            flex: 0 0 38px; width: 38px; height: 38px;
            display: flex; align-items: center; justify-content: center;
            border-radius: 12px; font-size: 22px !important; color: #fff;
            background: linear-gradient(145deg, #29a9e1, #4b79cf);
            box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
        }
        .qp-rule:nth-of-type(3n+2) > .material-symbols-outlined { background: linear-gradient(145deg, #ff9800, #ff5722); }
        .qp-rule:nth-of-type(3n) > .material-symbols-outlined { background: linear-gradient(145deg, #2fb36f, #198754); }
        .qp-rule b { display: block; font-size: 15px; margin-bottom: 2px; }
        .qp-rule ul { margin: 6px 0 0; padding-left: 18px; }
        .qp-rule li { margin-bottom: 3px; }
        .qp-rule li b { display: inline; font-size: inherit; }
        .qp-rules-table { width: 100%; margin: 0 0 16px; border-collapse: separate; border-spacing: 0; overflow: hidden; border-radius: 14px; font-size: 14px; text-align: center; box-shadow: 0 4px 12px rgba(18, 90, 160, .12); }
        .qp-rules-table th { padding: 8px; color: #fff; background: linear-gradient(120deg, #29a9e1, #4b79cf); }
        .qp-rules-table td { padding: 7px 8px; color: var(--text-dark); background: var(--surface-1); border-top: 1px solid var(--border-color, #eee); }
        .qp-rules-table tr.now td { font-weight: 800; color: #7a5200; background: #ffe9a8; }

        /* ---------- share dialog ---------- */
        .qrs .modal-header { color: #fff; border-bottom: 0; background: linear-gradient(120deg, #29a9e1, #4b79cf 60%, #a24bcf); }
        .qrs .modal-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; }
        .qrs-preview { min-height: 220px; display: flex; align-items: center; justify-content: center; border-radius: 18px; overflow: hidden; background: var(--surface-3, #eef5fb); }
        .qrs-preview img { display: block; width: 100%; max-height: 60vh; object-fit: contain; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); border-radius: 18px; }
        .qrs-loading { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 0; color: var(--text-light); }
        .qrs-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
        .qrs-row { display: flex; gap: 10px; }
        .qrs-btn {
            flex: 1 1 0;
            display: flex; align-items: center; justify-content: center; gap: 6px;
            padding: 11px 10px;
            border: 2px solid var(--border-color, #e0e0e0); border-radius: 14px;
            font-weight: 700; font-size: 15px;
            color: var(--text-dark); background: var(--surface-1);
        }
        .qrs-btn .material-symbols-outlined { font-size: 22px !important; }
        .qrs-btn:disabled { opacity: .5; }
        .qrs-main { width: 100%; color: #fff; border: 0; background: linear-gradient(120deg, #ff9800, #ff5722); box-shadow: 0 8px 18px rgba(255, 112, 30, .4); }
        .qrs-wa { color: #fff; border: 0; background: #25d366; }
        .qrs-fb { color: #fff; border: 0; background: #1877f2; }
