@import url('willow-scrollbar.css');
/* Live Quiz — host board, join, lobby jokes */

/* Live Quiz — host board, join, lobby jokes */

.quiz-bg-scene {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.quiz-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.55;
    will-change: transform;
}

.quiz-blob-a {
    width: 28rem;
    height: 28rem;
    left: -8rem;
    top: 8%;
    background: #93c5fd;
    animation: quiz-blob-float-a 8s ease-in-out infinite;
}

.quiz-blob-b {
    width: 22rem;
    height: 22rem;
    right: -6rem;
    top: 18%;
    background: #fde68a;
    animation: quiz-blob-float-b 10s ease-in-out infinite;
}

.quiz-blob-c {
    width: 26rem;
    height: 26rem;
    left: 28%;
    bottom: -10rem;
    background: #c4b5fd;
    animation: quiz-blob-float-c 9s ease-in-out infinite;
}

.quiz-blob-d {
    width: 16rem;
    height: 16rem;
    right: 22%;
    bottom: 12%;
    background: #67e8f9;
    opacity: 0.28;
    animation: quiz-blob-float-a 16s ease-in-out infinite reverse;
}

@keyframes quiz-blob-float-a {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(4%, 6%) scale(1.08); }
}

@keyframes quiz-blob-float-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-5%, 4%) scale(1.06); }
}

@keyframes quiz-blob-float-c {
    0%, 100% { transform: translate(0, 0) scale(1.02); }
    50% { transform: translate(3%, -5%) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .quiz-blob { animation: none; }
    .ql-host-page::before { animation: none; }
    .ql-joke, .ql-joke-word { animation: none !important; transition: opacity 0.2s ease; }
    .ql-joke.is-out { filter: none; transform: none; }
}

header.share-topbar,
main {
    position: relative;
    z-index: 1;
}

.ql-join-card {
    background: var(--share-card, #fff);
    border-radius: 1.5rem;
    padding: 1.75rem 1.6rem 1.5rem;
    box-shadow: 0 22px 48px rgba(var(--quiz-accent-rgb, 0, 26, 114), 0.10);
    border: 1px solid var(--share-border, rgba(0, 26, 114, 0.08));
}

.ql-kicker {
    display: inline-flex;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--quiz-kicker-fg, #b91c1c);
    background: var(--quiz-kicker-bg, #fee2e2);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    margin-bottom: 0.75rem;
}

.ql-join-card h2,
.ql-join-card .quiz-field,
.ql-join-card label {
    display: block;
}

.ql-join-card h2 {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--share-text, #0f172a);
    margin: 0 0 0.4rem;
}

.ql-join-card .quiz-field,
.ql-join-card label.quiz-field {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--share-text, #334155);
    margin: 0.9rem 0 0.35rem;
}

.ql-join-card input,
.ql-join-card select {
    width: 100%;
    border: 1.5px solid var(--share-border, #c7d2fe);
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
    background: var(--share-bg, #f8fafc);
    font-size: 1.05rem;
    color: var(--share-text, #0f172a);
}

.ql-code-input {
    font-family: ui-monospace, Consolas, monospace;
    letter-spacing: 0.16em;
    font-weight: 800;
    text-transform: uppercase;
}

.ql-join-submit {
    width: 100%;
    margin-top: 1.15rem;
    min-height: 3.1rem;
    border: 0;
    border-radius: 0.95rem;
    background: var(--quiz-bar, linear-gradient(135deg, #001A72, #2563eb));
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
}

.ql-join-url {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    word-break: break-all;
}

.ql-wait-screen {
    min-height: 58vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 0.5rem 3rem;
}
.ql-wait-screen.hidden {
    display: none !important;
}

.ql-wait-hello {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--share-accent, #001A72);
    margin: 0.4rem 0 1.5rem;
}

.ql-joke {
    font-size: clamp(1.55rem, 4.2vw, 2.55rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.35;
    color: var(--share-accent, #001A72);
    max-width: 42rem;
    min-height: 6.5rem;
    margin: 0 auto;
    perspective: 640px;
    transition: opacity 0.38s ease, transform 0.38s ease, filter 0.38s ease;
}

.ql-joke-word {
    display: inline-block;
    color: var(--share-accent, #001A72);
    animation: ql-joke-word-in 0.55s cubic-bezier(.2, 1.25, .3, 1) both;
}

.ql-joke.is-out {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(-14px) scale(0.96);
}

.ql-joke.is-in {
    opacity: 1;
    filter: blur(0);
    transform: none;
}

@keyframes ql-joke-word-in {
    from {
        opacity: 0;
        transform: translateY(0.85em) rotateX(-55deg) scale(0.92);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: none;
        filter: none;
    }
}

@keyframes ql-joke-shine {
    0% { background-position: 0% 50%; }
    100% { background-position: 220% 50%; }
}

.ql-wait-hint {
    margin-top: 1.75rem;
    color: #64748b;
    font-weight: 600;
}

.ql-done-joke {
    min-height: 0;
    font-size: clamp(1.05rem, 2.8vw, 1.5rem);
    margin: 1.15rem auto 0;
    max-width: 36rem;
}

/* Host page */
.ql-host-page {
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, sans-serif;
    background: linear-gradient(165deg, #e0f2fe 0%, #eef2ff 45%, #fff7ed 100%);
    color: #0f172a;
}
.ql-host-page::before {
    content: "";
    position: fixed;
    inset: -16%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 215, 0, 0.24), transparent 34%),
        radial-gradient(circle at 80% 16%, rgba(56, 189, 248, 0.2), transparent 38%),
        radial-gradient(circle at 50% 90%, rgba(129, 140, 248, 0.18), transparent 40%);
    animation: quiz-wash 10s ease-in-out infinite alternate;
}
@keyframes quiz-wash {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-3%, 2.5%, 0) scale(1.07); }
}

.ql-host-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.ql-host-bg .quiz-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.4;
}

.ql-host-bg .quiz-blob-a {
    width: 26rem; height: 26rem; left: -6rem; top: 10%;
    background: #93c5fd;
    animation: ql-float 12s ease-in-out infinite;
}
.ql-host-bg .quiz-blob-b {
    width: 20rem; height: 20rem; right: -5rem; top: 20%;
    background: #fde68a;
    animation: ql-float 14s ease-in-out infinite reverse;
}
.ql-host-bg .quiz-blob-c {
    width: 24rem; height: 24rem; left: 35%; bottom: -8rem;
    background: #c4b5fd;
    animation: ql-float 13s ease-in-out infinite;
}

@keyframes ql-float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(3%, 5%); }
}

.ql-host-bar {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) minmax(0, 2.4fr) minmax(10rem, 1fr);
    align-items: center;
    gap: 0.75rem;
    min-height: 4.35rem;
    padding: 0.65rem 1rem;
    background: #001A72;
    color: #fff;
}

.ql-host-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}

.ql-host-brand img {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    object-fit: cover;
    background: #fff;
}

.ql-host-title {
    margin: 0;
    text-align: center;
    font-size: clamp(1.05rem, 2.4vw, 1.55rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.ql-host-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.ql-btn {
    border: 0;
    border-radius: 0.7rem;
    padding: 0.55rem 0.95rem;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
}
.ql-btn svg {
    width: 1rem;
    height: 1rem;
}

.ql-btn-start {
    background: #16a34a;
    color: #fff;
}

.ql-btn-end {
    background: #dc2626;
    color: #fff;
}

.ql-btn-ghost {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.25);
}

.ql-host-main {
    position: relative;
    z-index: 1;
    padding: 1.25rem 1.25rem 3rem;
    max-width: 92rem;
    margin: 0 auto;
}

.ql-host-lobby {
    text-align: center;
    padding: 0.5rem 0 1.5rem;
    min-height: calc(100vh - 7.5rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ql-join-label,
.ql-code-label {
    font-size: clamp(1.05rem, 2.4vw, 1.65rem);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #334155;
    margin: 0;
}

.ql-join-link {
    font-size: clamp(2.1rem, 6.2vw, 4.4rem);
    font-weight: 850;
    color: #001A72;
    margin: 0.35rem 0 1.6rem;
    line-height: 1.15;
    max-width: 100%;
    white-space: nowrap;
}

.ql-code-board {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(96vw, 56rem);
    padding: 1.4rem 1.6rem 1.55rem;
    margin: 0.55rem auto 1.5rem;
    border-radius: 1.4rem;
    background: #fff;
    border: 5px solid #001A72;
    color: #001A72;
    font-family: ui-monospace, Consolas, monospace;
    font-size: clamp(3.4rem, 14vw, 8.5rem);
    font-weight: 800;
    letter-spacing: 0.18em;
    text-indent: 0.12em;
    box-shadow: 0 22px 48px rgba(0, 26, 114, 0.16);
}

.ql-lobby-count {
    font-weight: 800;
    font-size: clamp(1.05rem, 2.2vw, 1.45rem);
    color: #001A72;
    margin: 0 0 1rem;
}

.ql-name-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    max-width: 48rem;
    margin: 0 auto;
}

.ql-name-chip {
    background: #fff;
    border-radius: 999px;
    padding: 0.4rem 0.9rem;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    animation: quiz-card-in 0.25s ease;
}

@keyframes quiz-card-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.ql-host-msg {
    color: #b91c1c;
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.quiz-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: 0.85rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.875rem;
    margin-bottom: 0.9rem;
}

.quiz-hint {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0 0 0.5rem;
}

.ql-board-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.ql-code-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 2px solid #001A72;
    background: #fff;
    color: #001A72;
    border-radius: 999px;
    padding: 0.28rem 0.75rem 0.28rem 0.65rem;
    cursor: pointer;
    font-weight: 800;
}
.ql-code-chip span {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}
.ql-code-chip strong {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
}
.ql-code-chip:hover { background: #001A72; color: #fff; }
.ql-code-chip:hover span { color: #bfdbfe; }

.ql-btn-png {
    background: #0f766e;
    color: #fff;
}

.ql-code-modal-panel {
    width: min(96vw, 52rem);
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
    border-radius: 1.6rem;
    background: #fff;
    box-shadow: 0 32px 80px rgba(0, 26, 114, 0.28);
}
.ql-code-modal-kicker {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #64748b;
}
.ql-code-modal-url {
    margin: 0.45rem 0 0.75rem;
    font-size: clamp(1.55rem, 3.8vw, 2.7rem);
    font-weight: 800;
    color: #001A72;
    line-height: 1.25;
    overflow-wrap: break-word;
}
.ql-code-modal-code {
    display: inline-block;
    margin: 0 0 1.25rem;
    padding: 0.35rem 0.95rem;
    border-radius: 0.85rem;
    background: #eef2ff;
    border: 3px solid #001A72;
    font-family: ui-monospace, Consolas, monospace;
    font-size: clamp(1.35rem, 3.2vw, 2.3rem);
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #001A72;
    line-height: 1.2;
}

.ql-host-board h2 {
    margin: 0;
    font-size: 1.5rem;
}

.ql-board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 0.85rem;
}

.ql-board-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.ql-host-board.is-cards {
    max-width: none;
}

.ql-board-tools p {
    margin: 0;
    color: #475569;
    font-weight: 600;
}

.ql-zoom {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.2rem 0.3rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.ql-zoom button {
    width: 2.1rem;
    height: 2.1rem;
    border: 0;
    border-radius: 999px;
    background: #001A72;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.ql-zoom button:hover { background: #001454; }
.ql-zoom button:disabled { opacity: 0.4; cursor: default; }

.ql-zoom span {
    min-width: 3.2rem;
    text-align: center;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
    font-size: 0.85rem;
}

.ql-table-wrap {
    background: #fff;
    border-radius: 1.1rem;
    overflow: auto;
    box-shadow: 0 16px 36px rgba(0, 26, 114, 0.1);
    --ql-table-fs: 1.35rem;
}

.ql-score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--ql-table-fs);
}

.ql-score-table th,
.ql-score-table td {
    text-align: left;
    padding: 0.7em 0.85em;
    border-bottom: 1px solid #e2e8f0;
}

.ql-score-table th {
    background: #001A72;
    color: #fff;
    font-size: 0.72em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ql-score-table td {
    font-weight: 800;
}
.ql-score-table .ql-prog {
    min-width: 8.5rem;
    vertical-align: middle;
}
.ql-sc {
    display: inline-block;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

.ql-score-table td strong {
    font-size: 1.08em;
}

.ql-resume {
    margin: 0 0 1.1rem;
    padding: 0.9rem 1rem;
    border: 1.5px solid #c7d2fe;
    background: #eef2ff;
    border-radius: 0.95rem;
}

.ql-resume p {
    margin: 0 0 0.7rem;
    color: #1e293b;
    font-weight: 600;
}

.ql-resume-btn {
    display: inline-flex;
    text-decoration: none;
    text-align: center;
}

.quiz-locked-hint {
    margin: 0.65rem 0 0;
    font-size: 0.85rem;
    color: #b45309;
    font-weight: 600;
}

.quiz-option.is-locked,
.quiz-card textarea:disabled {
    opacity: 0.72;
    pointer-events: none;
}

.ql-score-table tbody tr:nth-child(1) td:first-child { color: #ca8a04; font-weight: 800; }
.ql-score-table .ql-offline { opacity: 0.5; }

.willow-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.willow-modal-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 28rem;
    max-height: min(90vh, 36rem);
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.28);
}
.willow-modal-header {
    padding: 1.25rem 1.5rem 0.4rem;
}
.willow-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #0f172a;
}
.willow-modal-header p,
.willow-modal-body p {
    margin: 0.35rem 0 0;
    color: #64748b;
    font-size: 0.9rem;
}
.willow-modal-body {
    padding: 0.5rem 1.5rem 1rem;
    overflow: auto;
}
.willow-modal-body input {
    width: 100%;
    box-sizing: border-box;
    border: 1.5px solid #c7d2fe;
    border-radius: 0.75rem;
    padding: 0.7rem 0.85rem;
    font-size: 1rem;
}
.willow-modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
    padding: 1rem 1.5rem 1.25rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}
.willow-modal-footer .ql-btn-ghost {
    background: #f1f5f9;
    color: #0f172a;
    border: 0;
}
#willow-confirm-ok.is-danger {
    background: #dc2626;
    color: #fff;
}

.ql-btn-bonus {
    background: #f59e0b;
    color: #111827;
}
.ql-btn-shake {
    background: #7c3aed;
    color: #fff;
}
.ql-btn-icon {
    width: 2.45rem;
    min-width: 2.45rem;
    height: 2.45rem;
    padding: 0;
    justify-content: center;
}
.ql-btn-icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.ql-goal-field {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    padding: 0.2rem 0.65rem 0.2rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ql-goal-field input {
    width: 3.6rem;
    border: 0;
    background: transparent;
    font-weight: 800;
    font-size: 0.95rem;
    color: #0f172a;
    text-transform: none;
    letter-spacing: 0;
}

.ql-view-toggle {
    display: inline-flex;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    overflow: hidden;
}
.ql-view-toggle button {
    border: 0;
    background: transparent;
    padding: 0.4rem 0.85rem;
    font-weight: 800;
    font-size: 0.8rem;
    color: #475569;
    cursor: pointer;
}
.ql-view-toggle button.is-on {
    background: #001A72;
    color: #fff;
}

.ql-pbar {
    display: flex;
    height: 0.85em;
    min-width: 6.5rem;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}
.ql-student-card .ql-pbar {
    height: 0.78em;
    min-width: 0;
    margin-top: 0.15rem;
}
.ql-pbar-ok,
.ql-pbar-bad,
.ql-pbar-rest {
    height: 100%;
    width: 0;
    min-width: 0;
    flex-grow: 0;
    flex-shrink: 0;
    flex-basis: 0;
}
.ql-pbar-ok { background: linear-gradient(90deg, #15803d, #4ade80); }
.ql-pbar-bad { background: linear-gradient(90deg, #b91c1c, #fb7185); }
.ql-pbar-rest { background: transparent; }
.ql-tally {
    display: flex;
    gap: 0.35rem;
    margin: 0.28rem 0 0;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.ql-tally-ok,
.ql-tally-bad {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55em;
    padding: 0.18em 0.4em;
    border-radius: 999px;
    font-size: 0.82em;
}
.ql-tally-ok {
    color: #166534;
    background: #dcfce7;
}
.ql-tally-bad {
    color: #991b1b;
    background: #fee2e2;
}
.ql-student-card .ql-tally {
    margin-top: 0.32rem;
    font-size: calc(0.95em * var(--ql-board-zoom, 1));
}

.ql-score-table tbody tr {
    transition: background 0.35s ease, transform 0.25s ease;
}
.ql-score-table tbody tr.ql-row-done {
    background: #ecfdf5;
}
.ql-score-table tbody tr.ql-row-retry {
    background: #fff7ed;
}
.ql-score-table tbody tr.ql-row-done td:first-child { color: #15803d; }
.ql-score-table tbody tr.ql-row-retry td:first-child { color: #c2410c; }
.ql-score-pop {
    display: inline-block;
    animation: ql-score-pop 0.4s cubic-bezier(.2,1.4,.3,1);
}

.ql-host-board.is-cards .ql-table-wrap { display: none; }
.ql-host-board.is-cards .ql-cards-space { display: grid; }

.ql-cards-space {
    --ql-board-zoom: 1;
    --ql-card-min: 11rem;
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(var(--ql-card-min), 1fr));
    gap: 0.55rem;
    min-height: 0;
    align-content: start;
    overflow: visible;
}

.ql-student-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: calc(0.22rem * var(--ql-board-zoom, 1));
    min-height: 0;
    padding: calc(0.5rem * var(--ql-board-zoom, 1)) calc(0.65rem * var(--ql-board-zoom, 1)) calc(0.45rem * var(--ql-board-zoom, 1));
    background: #fff;
    border-radius: 0.8rem;
    border: 2px solid rgba(0, 26, 114, 0.08);
    box-shadow: 0 8px 18px rgba(0, 26, 114, 0.08);
    transform-origin: center center;
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
    animation: quiz-card-in 0.32s ease;
}
.ql-student-card.ql-row-done {
    background: #ecfdf5;
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.22);
}
.ql-student-card.ql-row-retry {
    background: #fff7ed;
    border-color: #fdba74;
}
.ql-student-card.ql-offline { opacity: 0.55; }
.ql-student-card h3 {
    margin: 0;
    font-size: calc(0.95rem * var(--ql-board-zoom, 1));
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
    line-height: 1.2;
}
.ql-card-grade {
    margin: 0;
    font-size: calc(0.68rem * var(--ql-board-zoom, 1));
    font-weight: 700;
    color: #64748b;
}
.ql-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.35rem;
    font-weight: 800;
    font-size: calc(0.78rem * var(--ql-board-zoom, 1));
    color: #334155;
}
.ql-card-meta strong { color: #001A72; font-size: calc(0.95rem * var(--ql-board-zoom, 1)); }
.ql-score-table tbody tr[data-pid],
.ql-student-card,
.ql-name-chip[data-pid] {
    cursor: context-menu;
}

.ql-ctx {
    position: fixed;
    z-index: 80;
    min-width: 13.5rem;
    padding: 0.4rem;
    background: #fff;
    border: 1px solid #dbe4ff;
    border-radius: 0.85rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.ql-ctx.hidden { display: none !important; }
.ql-ctx-name {
    margin: 0 0 0.25rem;
    padding: 0.35rem 0.55rem 0.45rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}
.ql-ctx button {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 0.55rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
}
.ql-ctx button:hover { background: #eef2ff; }
.ql-ctx-danger { color: #b91c1c !important; }
.ql-ctx-danger:hover { background: #fef2f2 !important; }

.ql-retry-btn {
    display: block;
    width: 100%;
    margin-top: 1.25rem;
    min-height: 4.1rem;
    border: 0;
    border-radius: 1.1rem;
    background: linear-gradient(135deg, #ea580c, #f59e0b);
    color: #fff;
    font-size: 1.55rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 16px 32px rgba(234, 88, 12, 0.28);
    animation: ql-retry-pulse 1.6s ease-in-out infinite;
}
@keyframes ql-retry-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.ql-done-screen .quiz-card.ql-done-ok { border-color: #86efac; background: #f0fdf4; }
.ql-done-screen .quiz-card.ql-done-retry { border-color: #fdba74; background: #fff7ed; }
.ql-done-close {
    margin-top: 0.85rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: #001A72;
}

.ql-fx-bonus {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 26, 114, 0.42);
    animation: ql-bonus-fade 0.25s ease;
    pointer-events: none;
}
.ql-fx-bonus.hidden { display: none !important; }
.ql-fx-bonus-card {
    text-align: center;
    padding: 1.8rem 2.4rem;
    border-radius: 1.5rem;
    background: linear-gradient(160deg, #fff7ed, #fef3c7 55%, #fff);
    border: 4px solid #f59e0b;
    box-shadow: 0 28px 60px rgba(245, 158, 11, 0.35);
    animation: ql-bonus-pop 0.5s cubic-bezier(.2,1.5,.3,1);
}
.ql-fx-bonus-card strong {
    display: block;
    font-size: clamp(3.2rem, 10vw, 5.5rem);
    line-height: 1;
    color: #ea580c;
    letter-spacing: -0.04em;
}
.ql-fx-bonus-card p {
    margin: 0.4rem 0 0;
    font-weight: 800;
    font-size: 1.2rem;
    color: #9a3412;
}
@keyframes ql-bonus-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes ql-bonus-pop {
    0% { transform: scale(0.4) rotate(-8deg); opacity: 0; }
    70% { transform: scale(1.08) rotate(2deg); }
    100% { transform: scale(1) rotate(0); }
}
@keyframes ql-score-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.22); }
    100% { transform: scale(1); }
}

.ql-fx-stage {
    position: fixed;
    inset: 0;
    z-index: 84;
    pointer-events: none;
    overflow: hidden;
}
.ql-fx-stage.hidden { display: none !important; }
.ql-fx-aurora,
.ql-fx-party {
    background:
        radial-gradient(circle at 18% 24%, rgba(56, 189, 248, 0.34), transparent 40%),
        radial-gradient(circle at 82% 18%, rgba(251, 191, 36, 0.32), transparent 42%),
        radial-gradient(circle at 50% 82%, rgba(167, 139, 250, 0.28), transparent 46%);
    animation: ql-fx-fade 6.6s ease-in-out both;
}
.ql-fx-spotlight {
    background:
        radial-gradient(circle at 50% 40%, rgba(253, 230, 138, 0.48), transparent 34%),
        radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.18), transparent 56%);
    animation: ql-fx-fade 6.6s ease-in-out both;
}
.ql-fx-cheer {
    background:
        radial-gradient(circle at 30% 30%, rgba(52, 211, 153, 0.28), transparent 42%),
        radial-gradient(circle at 70% 70%, rgba(251, 191, 36, 0.26), transparent 46%);
    animation: ql-fx-fade 6.6s ease-in-out both;
}
.ql-fx-sunset {
    background:
        radial-gradient(circle at 18% 82%, rgba(251, 146, 60, 0.42), transparent 42%),
        radial-gradient(circle at 78% 22%, rgba(244, 114, 182, 0.28), transparent 46%),
        radial-gradient(circle at 50% 48%, rgba(253, 224, 71, 0.22), transparent 52%);
    animation: ql-fx-fade 6.6s ease-in-out both;
}
.ql-fx-mosaic {
    background:
        repeating-linear-gradient(135deg, rgba(56, 189, 248, 0.12) 0 18px, transparent 18px 36px),
        radial-gradient(circle at 30% 30%, rgba(167, 139, 250, 0.28), transparent 46%),
        radial-gradient(circle at 80% 70%, rgba(251, 191, 36, 0.22), transparent 48%);
    animation: ql-fx-fade 6.6s ease-in-out both;
}
.ql-fx-name-wrap {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    margin: 0;
    text-align: center;
    max-width: 92vw;
    z-index: 2;
}
.ql-fx-name,
.ql-fx-cheer-sub {
    margin: 0;
    text-align: center;
    font-weight: 800;
    color: #001A72;
    text-shadow: 0 8px 28px rgba(255, 255, 255, 0.72);
    line-height: 1.05;
    word-break: break-word;
}
.ql-fx-name {
    font-size: clamp(4.6rem, 20vw, 12rem);
    letter-spacing: -0.04em;
    animation: ql-fx-name-flash 1.15s ease-in-out infinite;
}
.ql-fx-cheer-sub {
    display: block;
    margin-top: 0.55rem;
    font-size: clamp(1.15rem, 3.4vw, 1.85rem);
    font-weight: 800;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 12px 32px rgba(0, 26, 114, 0.14);
}
.ql-fx-name-script {
    font-family: "Segoe Script", "Brush Script MT", "Apple Chancery", cursive;
    font-weight: 600;
    letter-spacing: 0.02em;
    font-style: italic;
}
.ql-fx-name-outline {
    color: transparent;
    -webkit-text-stroke: 3px #001A72;
    text-stroke: 3px #001A72;
    text-shadow: 0 10px 24px rgba(251, 191, 36, 0.35);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.ql-fx-name-block {
    font-family: Impact, "Arial Black", "Franklin Gothic Heavy", sans-serif;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 900;
}
.ql-fx-name-neon {
    color: #fde68a;
    text-shadow:
        0 0 12px rgba(251, 191, 36, 1),
        0 0 28px rgba(56, 189, 248, 0.85),
        0 0 48px rgba(251, 191, 36, 0.55),
        0 12px 32px rgba(0, 26, 114, 0.3);
}
.ql-fx-name-stack {
    color: #001A72;
    text-shadow:
        3px 3px 0 #38bdf8,
        6px 6px 0 #fbbf24,
        0 14px 28px rgba(0, 26, 114, 0.2);
}
.ql-fx-name-stamp {
    font-family: Impact, "Arial Black", sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #001A72;
    border: 4px solid #001A72;
    padding: 0.15em 0.35em;
    border-radius: 0.2em;
    box-shadow: 6px 6px 0 #fbbf24;
    background: rgba(255, 255, 255, 0.72);
}
.ql-fx-name-ribbon {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    color: #7c2d12;
    background: linear-gradient(90deg, #fde68a, #fbbf24, #fde68a);
    padding: 0.12em 0.55em;
    border-radius: 999px;
    box-shadow: 0 10px 24px rgba(251, 191, 36, 0.35);
}
.ql-fx-name-letters .ql-fx-letter {
    display: inline-block;
    animation: ql-fx-letter-wave 1.05s ease-in-out infinite;
    text-shadow:
        0 0 18px rgba(251, 191, 36, 0.85),
        0 12px 32px rgba(0, 26, 114, 0.25);
}
.ql-fx-motion-still { animation: ql-fx-soft-in 6.6s ease-in-out both; }
.ql-fx-motion-wave { animation: ql-fx-soft-in 6.6s ease-in-out both; }
.ql-fx-motion-zoom { animation: ql-fx-zoom 6.6s ease-in-out both; }
.ql-fx-motion-float { animation: ql-fx-float 6.6s ease-in-out both; }
.ql-fx-motion-bounce { animation: ql-fx-bounce 6.6s ease-in-out both; }
.ql-fx-motion-orbit { animation: ql-fx-orbit 6.6s ease-in-out both; }
.ql-fx-motion-spin { animation: ql-fx-spin 6.6s ease-in-out both; }
.ql-fx-name-inner {
    display: inline-block;
    animation: ql-fx-name-flash 1.15s ease-in-out infinite;
}
.ql-fx-float-name {
    position: absolute;
    margin: 0;
    font-weight: 900;
    color: #001A72;
    line-height: 1.02;
    max-width: 72vw;
    word-break: break-word;
    transform: translate(-50%, -50%);
    text-shadow:
        0 0 22px rgba(251, 191, 36, 0.75),
        0 10px 28px rgba(255, 255, 255, 0.7);
    z-index: 2;
}
.ql-fx-spark,
.ql-fx-bubble {
    position: absolute;
    bottom: -10%;
    border-radius: 50%;
    animation: ql-fx-rise 5.8s ease-in-out both;
}
.ql-fx-spark {
    width: 0.72rem;
    height: 0.72rem;
    background: #fbbf24;
    border-radius: 2px;
    opacity: 0.95;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.85);
    animation-name: ql-fx-spark-rise;
}
.ql-fx-bubble {
    width: 1.7rem;
    height: 1.7rem;
    border: 2px solid rgba(37, 99, 235, 0.42);
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.75), transparent 36%),
        rgba(147, 197, 253, 0.28);
    box-shadow: inset 0 -6px 10px rgba(37, 99, 235, 0.12);
}
.ql-fx-bubble-lg {
    border-width: 3px;
    border-color: rgba(251, 191, 36, 0.45);
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.8), transparent 36%),
        rgba(253, 230, 138, 0.28);
}
.ql-host-page.ql-is-fx::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 80;
    pointer-events: none;
    background:
        radial-gradient(circle at 22% 28%, rgba(56, 189, 248, 0.28), transparent 40%),
        radial-gradient(circle at 78% 22%, rgba(251, 191, 36, 0.26), transparent 42%),
        radial-gradient(circle at 50% 80%, rgba(167, 139, 250, 0.22), transparent 46%);
    animation: ql-fx-fade 6.6s ease-in-out both;
}
@keyframes ql-fx-fade {
    0%, 100% { opacity: 0; }
    14%, 82% { opacity: 1; }
}
@keyframes ql-fx-soft-in {
    0%, 100% { opacity: 0; transform: translate(-50%, -46%); }
    16%, 80% { opacity: 1; transform: translate(-50%, -50%); }
}
@keyframes ql-fx-zoom {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.32); }
    16% { opacity: 1; transform: translate(-50%, -50%) scale(1.22); }
    34% { transform: translate(-50%, -50%) scale(0.9); }
    52% { transform: translate(-50%, -50%) scale(1.12); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.28); }
}
@keyframes ql-fx-float {
    0% { opacity: 0; transform: translate(-50%, -30%) scale(0.92); }
    16% { opacity: 1; transform: translate(-50%, -54%) scale(1.06); }
    50% { transform: translate(-50%, -42%) scale(1); }
    80% { opacity: 1; transform: translate(-50%, -58%) scale(1.08); }
    100% { opacity: 0; transform: translate(-50%, -70%) scale(1.12); }
}
@keyframes ql-fx-bounce {
    0% { opacity: 0; transform: translate(-50%, -20%) scale(0.6); }
    18% { opacity: 1; transform: translate(-50%, -56%) scale(1.16); }
    32% { transform: translate(-50%, -44%) scale(0.94); }
    48% { transform: translate(-50%, -52%) scale(1.08); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -62%) scale(1.18); }
}
@keyframes ql-fx-letter-wave {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    50% { transform: translateY(-22px) rotate(-8deg) scale(1.08); }
}
@keyframes ql-fx-name-flash {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.45));
        transform: scale(1);
    }
    50% {
        filter:
            drop-shadow(0 0 28px rgba(251, 191, 36, 1))
            drop-shadow(0 0 52px rgba(56, 189, 248, 0.7));
        transform: scale(1.08);
    }
}
@keyframes ql-fx-rise {
    0% { opacity: 0; transform: translate(0, 0) scale(0.7); }
    14% { opacity: 0.95; }
    100% { opacity: 0; transform: translate(var(--ql-fx-drift, 12px), -88vh) scale(1.12); }
}
@keyframes ql-fx-spark-rise {
    0% { opacity: 0; transform: rotate(20deg) translateY(0) scale(0.4); }
    16% { opacity: 1; transform: rotate(45deg) translateY(-12vh) scale(1.25); }
    100% { opacity: 0; transform: rotate(160deg) translateY(-86vh) scale(0.55); }
}
@keyframes ql-fx-orbit {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7) rotate(-8deg); }
    18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08) rotate(6deg); }
    50% { transform: translate(-42%, -58%) scale(1) rotate(-4deg); }
    82% { opacity: 1; transform: translate(-58%, -46%) scale(1.04) rotate(5deg); }
    100% { opacity: 0; transform: translate(-50%, -62%) scale(1.12) rotate(-6deg); }
}
@keyframes ql-fx-spin {
    0% { opacity: 0; transform: translate(-50%, -40%) rotate(-12deg) scale(0.8); }
    16% { opacity: 1; transform: translate(-50%, -50%) rotate(8deg) scale(1.06); }
    50% { transform: translate(-50%, -50%) rotate(-6deg) scale(1); }
    84% { opacity: 1; transform: translate(-50%, -50%) rotate(4deg) scale(1.04); }
    100% { opacity: 0; transform: translate(-50%, -62%) rotate(-8deg) scale(1.1); }
}
@keyframes ql-fx-confetti-fall {
    0% { opacity: 0; transform: translateY(-8vh) rotate(0deg) scale(0.6); }
    12% { opacity: 1; }
    100% { opacity: 0; transform: translateY(92vh) rotate(var(--ql-fx-spin, 240deg)) scale(0.9); }
}
@keyframes ql-fx-ribbon-fall {
    0% { opacity: 0; transform: translateY(-10vh) rotate(-18deg); }
    14% { opacity: 1; }
    100% { opacity: 0; transform: translateY(88vh) rotate(22deg); }
}
@keyframes ql-fx-orbit-dot {
    0% { opacity: 0; transform: rotate(0deg) translateX(var(--ql-fx-orbit-r, 120px)) rotate(0deg); }
    12% { opacity: 1; }
    100% { opacity: 0; transform: rotate(360deg) translateX(var(--ql-fx-orbit-r, 120px)) rotate(-360deg); }
}

.ql-fx-confetti {
    position: absolute;
    top: -4%;
    width: 0.7rem;
    height: 1.15rem;
    border-radius: 0.15rem;
    animation: ql-fx-confetti-fall 4.4s ease-in both;
    z-index: 1;
}
.ql-fx-ribbon {
    position: absolute;
    top: -6%;
    width: 0.45rem;
    height: 4.2rem;
    border-radius: 999px;
    background: linear-gradient(180deg, #fbbf24, #f472b6, #38bdf8);
    animation: ql-fx-ribbon-fall 5.2s ease-in both;
    z-index: 1;
}
.ql-fx-orbit {
    position: absolute;
    left: 50%;
    top: 42%;
    width: 0.85rem;
    height: 0.85rem;
    margin: 0;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.8);
    animation: ql-fx-orbit-dot 4.8s linear both;
    z-index: 1;
}

#ql-play .quiz-card.is-flash-ok,
#ql-play .quiz-card.is-flash-bad,
#ql-play .quiz-option.is-flash-ok,
#ql-play .quiz-option.is-flash-bad {
    box-shadow: none;
    animation: none;
    filter: none;
}
.quiz-card.quiz-card-in { animation: quiz-card-in 0.32s ease; }

.ql-png-exporting .ql-score-pop,
.ql-png-exporting .ql-sc,
.ql-png-exporting .ql-student-card,
.ql-png-exporting .ql-score-table tbody tr,
.ql-png-exporting .ql-host-page::before,
.ql-png-exporting .quiz-blob,
.ql-png-exporting #ql-fx-stage,
.ql-png-exporting.ql-is-fx::after {
    animation: none !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
}
.ql-png-exporting #ql-fx-stage,
.ql-png-exporting.ql-is-fx::after {
    display: none !important;
}
.ql-png-exporting .ql-sc,
.ql-png-exporting .ql-score-table td,
.ql-png-exporting .ql-score-table td strong {
    font-weight: 800 !important;
    text-rendering: geometricPrecision;
    -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
    .ql-student-card,
    .ql-pbar-ok,
    .ql-pbar-bad,
    .ql-fx-bonus-card,
    .ql-retry-btn,
    .ql-fx-stage,
    .ql-fx-spark,
    .ql-fx-bubble,
    .ql-fx-name,
    .ql-fx-cheer,
    .ql-fx-cheer-sub,
    .ql-fx-name-wrap,
    .ql-fx-float-name,
    .ql-fx-letter,
    .ql-fx-confetti,
    .ql-fx-ribbon,
    .ql-fx-orbit,
    .ql-fx-name-inner,
    .ql-host-page.ql-is-fx::after { animation: none; }
    .ql-fx-stage:not(.hidden) { opacity: 0.85; }
    .ql-fx-name-letters .ql-fx-letter { transform: none; }
}

.hidden { display: none !important; }

@media (max-width: 720px) {
    .ql-host-bar {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .ql-host-brand { justify-content: center; }
    .ql-host-actions { justify-content: center; }
}

html[data-quiz-theme="black"] body.share-themed:has(.quiz-bg-scene) {
    background: #000;
    color: #f5f5f5;
}
html[data-quiz-theme="black"] .quiz-blob-a { background: #1e3a8a; }
html[data-quiz-theme="black"] .quiz-blob-b { background: #854d0e; }
html[data-quiz-theme="black"] .quiz-blob-c { background: #4c1d95; }
html[data-quiz-theme="black"] .quiz-blob-d { background: #155e75; }
html[data-quiz-theme="black"] .ql-host-page {
    background: #000;
    color: #f5f5f5;
}
html[data-quiz-theme="black"] .ql-host-page::before {
    background:
        radial-gradient(circle at 20% 20%, rgba(251, 191, 36, 0.16), transparent 34%),
        radial-gradient(circle at 80% 16%, rgba(56, 189, 248, 0.12), transparent 38%),
        radial-gradient(circle at 50% 90%, rgba(129, 140, 248, 0.1), transparent 40%);
}
html[data-quiz-theme="black"] .ql-host-bg .quiz-blob-a { background: #1e3a8a; }
html[data-quiz-theme="black"] .ql-host-bg .quiz-blob-b { background: #854d0e; }
html[data-quiz-theme="black"] .ql-host-bg .quiz-blob-c { background: #4c1d95; }
html[data-quiz-theme="black"] .ql-host-bar {
    background: #0a0a0a;
    border-bottom: 1px solid #2a2a2a;
}
html[data-quiz-theme="black"] .ql-join-label,
html[data-quiz-theme="black"] .ql-code-label,
html[data-quiz-theme="black"] .ql-wait-hint,
html[data-quiz-theme="black"] .ql-join-url,
html[data-quiz-theme="black"] .ql-lobby-count {
    color: #a3a3a3;
}
html[data-quiz-theme="black"] .ql-join-link,
html[data-quiz-theme="black"] .ql-wait-hello,
html[data-quiz-theme="black"] .ql-joke {
    color: #fde68a;
}
html[data-quiz-theme="black"] .ql-joke-word {
    background: linear-gradient(115deg, #fde68a 0%, #fbbf24 32%, #38bdf8 58%, #c084fc 82%, #fde68a 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    background-clip: text;
}
html[data-quiz-theme="black"] .ql-join-card,
html[data-quiz-theme="black"] .ql-table-wrap,
html[data-quiz-theme="black"] .ql-student-card,
html[data-quiz-theme="black"] .willow-modal-panel {
    background: #141414;
    border-color: #2a2a2a;
    color: #f5f5f5;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55);
}
html[data-quiz-theme="black"] .ql-student-card.ql-row-done,
html.dark .ql-student-card.ql-row-done {
    background: #14532d;
    border-color: #4ade80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.4);
}
html[data-quiz-theme="black"] .ql-student-card.ql-row-done h3,
html.dark .ql-student-card.ql-row-done h3 {
    color: #bbf7d0;
}
html[data-quiz-theme="black"] .ql-join-card h2,
html[data-quiz-theme="black"] .ql-student-card:not(.ql-row-done) h3,
html[data-quiz-theme="black"] .ql-board-title-row h2 {
    color: #f5f5f5;
}
html[data-quiz-theme="black"] .ql-join-card .quiz-field,
html[data-quiz-theme="black"] .ql-join-card label,
html[data-quiz-theme="black"] .ql-card-grade,
html[data-quiz-theme="black"] .ql-card-meta {
    color: #d4d4d4;
}
html[data-quiz-theme="black"] .ql-join-card input,
html[data-quiz-theme="black"] .ql-join-card select {
    background: #0a0a0a;
    border-color: #3f3f3f;
    color: #f5f5f5;
}
html[data-quiz-theme="black"] .ql-join-submit {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #111;
}
html[data-quiz-theme="black"] .ql-kicker {
    color: #fecaca;
    background: #3f1111;
}
html[data-quiz-theme="black"] .ql-code-board {
    background: #141414;
    color: #fde68a;
    border-color: #fbbf24;
}
html[data-quiz-theme="black"] .ql-name-chip {
    background: #1a1a1a;
    color: #f5f5f5;
    border-color: #3f3f3f;
}
html[data-quiz-theme="black"] .ql-score-table th {
    background: #0a0a0a;
    color: #fde68a;
}
html[data-quiz-theme="black"] .ql-score-table td {
    color: #f5f5f5;
    border-bottom-color: #2a2a2a;
}
html[data-quiz-theme="black"] .ql-score-table tbody tr.ql-row-done {
    background: #052e16;
}
html[data-quiz-theme="black"] .ql-score-table tbody tr.ql-row-retry {
    background: #3f1d07;
}
html[data-quiz-theme="black"] .ql-score-table tbody tr.ql-row-done td:first-child { color: #4ade80; }
html[data-quiz-theme="black"] .ql-score-table tbody tr.ql-row-retry td:first-child { color: #fdba74; }
html[data-quiz-theme="black"] .ql-pbar {
    background: #262626;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
html[data-quiz-theme="black"] .ql-pbar-ok { background: linear-gradient(90deg, #166534, #4ade80); }
html[data-quiz-theme="black"] .ql-pbar-bad { background: linear-gradient(90deg, #991b1b, #fb7185); }
html[data-quiz-theme="black"] .ql-tally-ok {
    color: #bbf7d0;
    background: #14532d;
}
html[data-quiz-theme="black"] .ql-tally-bad {
    color: #fecaca;
    background: #7f1d1d;
}
html[data-quiz-theme="black"] .ql-student-card.ql-row-done {
    background: #14532d;
    border-color: #4ade80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.4);
}
html[data-quiz-theme="black"] .ql-student-card.ql-row-done h3,
html.dark .ql-student-card.ql-row-done h3 {
    color: #bbf7d0;
}
html[data-quiz-theme="black"] .ql-student-card.ql-row-retry {
    background: #3f1d07;
    border-color: #9a3412;
}
html[data-quiz-theme="black"] .ql-card-meta strong,
html[data-quiz-theme="black"] .ql-sc {
    color: #fde68a;
}
html[data-quiz-theme="black"] .ql-zoom {
    background: #141414;
    border-color: #3f3f3f;
}
html[data-quiz-theme="black"] .ql-zoom span { color: #f5f5f5; }
html[data-quiz-theme="black"] .ql-zoom button {
    background: #fbbf24;
    color: #111;
}
html[data-quiz-theme="black"] .ql-goal-field {
    background: #141414;
    border-color: #3f3f3f;
    color: #d4d4d4;
}
html[data-quiz-theme="black"] .ql-goal-field input {
    color: #fde68a;
}
html[data-quiz-theme="black"] .ql-view-toggle {
    background: #141414;
    border-color: #3f3f3f;
}
html[data-quiz-theme="black"] .ql-view-toggle button {
    color: #a3a3a3;
}
html[data-quiz-theme="black"] .ql-view-toggle button.is-on {
    background: #fbbf24;
    color: #111;
}
html[data-quiz-theme="black"] .ql-board-tools p {
    color: #a3a3a3;
}
html[data-quiz-theme="black"] .ql-host-msg {
    color: #fca5a5;
}
html[data-quiz-theme="black"] .ql-code-modal-panel {
    background: #141414;
    color: #f5f5f5;
}
html[data-quiz-theme="black"] .ql-code-modal-code {
    color: #fde68a;
    background: #141414;
    border-color: #fbbf24;
}
html[data-quiz-theme="black"] .ql-code-modal-url { color: #f8fafc; }
html[data-quiz-theme="black"] .ql-code-modal-kicker {
    color: #a3a3a3;
}
html[data-quiz-theme="black"] .ql-code-chip {
    background: #1a1a1a;
    color: #fde68a;
    border-color: #fbbf24;
}
html[data-quiz-theme="black"] .ql-code-chip span {
    color: #a3a3a3;
}
html[data-quiz-theme="black"] .ql-code-chip:hover {
    background: #fbbf24;
    color: #111;
}
html[data-quiz-theme="black"] .ql-code-chip:hover span {
    color: #422006;
}
html[data-quiz-theme="black"] .ql-done-screen .quiz-card.ql-done-ok {
    border-color: #166534;
    background: #052e16;
}
html[data-quiz-theme="black"] .ql-done-screen .quiz-card.ql-done-retry {
    border-color: #9a3412;
    background: #3f1d07;
}
html[data-quiz-theme="black"] .ql-done-close {
    color: #fde68a;
}
html[data-quiz-theme="black"] .ql-retry-btn {
    color: #111;
}
html[data-quiz-theme="black"] .ql-ctx {
    background: #141414;
    border-color: #3f3f3f;
    color: #f5f5f5;
}
html[data-quiz-theme="black"] .ql-ctx-name {
    color: #a3a3a3;
    border-bottom-color: #2a2a2a;
}
html[data-quiz-theme="black"] .ql-ctx button {
    color: #f5f5f5;
}
html[data-quiz-theme="black"] .ql-ctx button:hover {
    background: #262626;
}
html[data-quiz-theme="black"] .ql-ctx-danger {
    color: #fca5a5 !important;
}
html[data-quiz-theme="black"] .ql-ctx-danger:hover {
    background: #3f1111 !important;
}
html[data-quiz-theme="black"] .ql-resume {
    background: #1a1a1a;
    border-color: #3f3f3f;
}
html[data-quiz-theme="black"] .ql-resume p { color: #e5e5e5; }
html[data-quiz-theme="black"] .quiz-locked-hint { color: #fbbf24; }
html[data-quiz-theme="black"] .willow-modal-header,
html[data-quiz-theme="black"] .willow-modal-body,
html[data-quiz-theme="black"] .willow-modal-footer {
    background: #141414;
    border-color: #2a2a2a;
    color: #f5f5f5;
}
html[data-quiz-theme="black"] .willow-modal-header h3,
html[data-quiz-theme="black"] #willow-confirm-title {
    color: #f5f5f5;
}
html[data-quiz-theme="black"] #willow-confirm-message {
    color: #d4d4d4;
}
html[data-quiz-theme="black"] #willow-confirm-cancel {
    background: #262626;
    color: #f5f5f5;
}
html[data-quiz-theme="black"] #willow-confirm-ok {
    background: #fbbf24;
    color: #111;
}
html[data-quiz-theme="black"] .willow-modal-body input {
    background: #0a0a0a;
    border-color: #3f3f3f;
    color: #f5f5f5;
}
html[data-quiz-theme="black"] .willow-modal-footer .ql-btn-ghost {
    background: #262626;
    color: #f5f5f5;
}
html[data-quiz-theme="black"] #ql-theme-toggle {
    border-color: rgba(251, 191, 36, 0.42);
    color: #fde68a;
}
html[data-quiz-theme="black"] .ql-fx-name,
html[data-quiz-theme="black"] .ql-fx-cheer,
html[data-quiz-theme="black"] .ql-fx-float-name {
    color: #fde68a;
    text-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}
html[data-quiz-theme="black"] .ql-fx-cheer,
html[data-quiz-theme="black"] .ql-fx-cheer-sub {
    background: rgba(20, 20, 20, 0.9);
    color: #fde68a;
}
html[data-quiz-theme="black"] .ql-fx-name-outline,
html[data-quiz-theme="black"] .ql-fx-float-name.ql-fx-name-outline {
    color: transparent;
    -webkit-text-stroke: 3px #fde68a;
    text-stroke: 3px #fde68a;
    text-shadow: 0 0 18px rgba(251, 191, 36, 0.45);
}
html[data-quiz-theme="black"] .ql-fx-name-stack,
html[data-quiz-theme="black"] .ql-fx-float-name.ql-fx-name-stack {
    color: #fde68a;
    text-shadow:
        3px 3px 0 #38bdf8,
        6px 6px 0 #f59e0b,
        0 14px 28px rgba(0, 0, 0, 0.45);
}
html[data-quiz-theme="black"] .ql-fx-name-neon,
html[data-quiz-theme="black"] .ql-fx-float-name.ql-fx-name-neon {
    color: #fde68a;
    text-shadow:
        0 0 8px rgba(251, 191, 36, 0.95),
        0 0 22px rgba(56, 189, 248, 0.7);
}
html[data-quiz-theme="black"] .ql-fx-bubble {
    border-color: rgba(251, 191, 36, 0.5);
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.35), transparent 36%),
        rgba(56, 189, 248, 0.18);
}
html[data-quiz-theme="black"] .ql-fx-name-stamp,
html[data-quiz-theme="black"] .ql-fx-float-name.ql-fx-name-stamp {
    color: #fde68a;
    border-color: #fbbf24;
    background: rgba(20, 20, 20, 0.82);
    box-shadow: 6px 6px 0 #f59e0b;
}
html[data-quiz-theme="black"] .ql-fx-name-ribbon,
html[data-quiz-theme="black"] .ql-fx-float-name.ql-fx-name-ribbon {
    color: #111;
    background: linear-gradient(90deg, #fde68a, #fbbf24, #fde68a);
}

/* Never paint selected options green/red — native dark widgets look like marking. */
#ql-play .quiz-option input[type="radio"],
#ql-play .quiz-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 1.15rem;
    height: 1.15rem;
    min-width: 1.15rem;
    margin-top: 0.2rem;
    border: 2px solid var(--share-accent, #001A72);
    background: var(--share-card, #fff);
    color-scheme: light;
    accent-color: var(--share-accent, #001A72);
    display: inline-grid;
    place-content: center;
}
#ql-play .quiz-option input[type="radio"] { border-radius: 50%; }
#ql-play .quiz-option input[type="checkbox"] { border-radius: 0.28rem; }
#ql-play .quiz-option input[type="radio"]::after,
#ql-play .quiz-option input[type="checkbox"]::after {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    transform: scale(0);
    background: var(--share-accent, #001A72);
    border-radius: inherit;
}
#ql-play .quiz-option input:checked::after { transform: scale(1); }
#ql-play .quiz-option:has(input:checked) {
    border-color: var(--share-accent, #001A72);
    background: linear-gradient(180deg, var(--quiz-option-tint, #eff6ff), var(--share-card, #fff));
    box-shadow: 0 0 0 3px rgba(var(--quiz-accent-rgb, 0, 26, 114), 0.14);
}
html[data-quiz-theme="black"] #ql-play .quiz-option:has(input:checked),
html.dark #ql-play .quiz-option:has(input:checked) {
    border-color: #fbbf24;
    background: linear-gradient(180deg, #3f2e00, #1a1a1a);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.22);
}
html[data-quiz-theme="black"] #ql-play .quiz-option input,
html.dark #ql-play .quiz-option input {
    border-color: #fbbf24;
    background: #0a0a0a;
    accent-color: #fbbf24;
}
html[data-quiz-theme="black"] #ql-play .quiz-option input::after,
html.dark #ql-play .quiz-option input::after {
    background: #fbbf24;
}

.ql-rename-gate {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.55);
}
.ql-rename-gate.hidden { display: none !important; }
.ql-rename-card {
    width: min(26rem, 100%);
    padding: 1.35rem 1.4rem 1.5rem;
    border-radius: 1.1rem;
    background: var(--share-card, #fff);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.28);
}
.ql-rename-card h2 {
    margin: 0.15rem 0 0.4rem;
    font-size: 1.2rem;
}
.ql-rename-card .ql-join-submit { margin-top: 0.85rem; }
html[data-quiz-theme="black"] .ql-rename-card,
html.dark .ql-rename-card {
    background: #171717;
    color: #f5f5f5;
}
