/* ─────────────────────────────────────────────────────
   EKGLab · Rhythm Quiz
   Premium light theme — two-column viewport layout,
   caliper/zoom tools, card surfaces.
───────────────────────────────────────────────────── */

:root {
    --qz-bg:            #f6f8fc;
    --qz-card-bg:       #ffffff;
    --qz-card-soft:     #f7f9fc;
    --qz-card-hover:    #f1f4f9;
    --qz-card-border:   rgba(15,23,42,0.07);
    --qz-card-border-2: rgba(15,23,42,0.12);
    --qz-card-shadow:   0 1px 2px rgba(15,23,42,0.04), 0 10px 28px -8px rgba(15,23,42,0.10);

    --qz-text:          #0f172a;
    --qz-text-sec:      #64748b;
    --qz-text-ter:      #94a3b8;

    --qz-brand:         #26408b;
    --qz-brand-deep:    #0f084b;
    --qz-brand-soft:    rgba(38,64,139,0.08);

    --qz-green:         #16a34a;
    --qz-red:           #dc2626;
    --qz-amber:         #d97706;
    --qz-green-bg:      rgba(22,163,74,0.07);
    --qz-red-bg:        rgba(220,38,38,0.06);
    --qz-amber-bg:      rgba(217,119,6,0.08);
    --qz-green-border:  rgba(22,163,74,0.30);
    --qz-red-border:    rgba(220,38,38,0.28);

    --qz-r-card:        18px;
    --qz-r-inner:       12px;
    --qz-r-pill:        999px;
}

/* ── App container ── */
#quizApp { width: 100%; }

/* ── Screens ── */
.quiz-screen {
    width: 100%;
    display: flex;
    flex-direction: column;
}
.quiz-screen[hidden] { display: none; }


/* ════════════════════════════════════════
   START SCREEN
════════════════════════════════════════ */
#screenStart {
    max-width: 520px;
    margin: 0 auto;
    padding: 28px 24px 56px;
    min-height: calc(100vh - 56px);
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: heroIn 0.55s cubic-bezier(0.22,1,0.36,1) both;
}

@keyframes heroIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}


.quiz-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 44px;
}

.quiz-hero-icon {
    width: 80px;
    height: 80px;
    border-radius: 22px;
    background: linear-gradient(145deg, #2c4eaa 0%, #1a2d66 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.18) inset,
        0 10px 28px rgba(38,64,139,0.30),
        0 3px 8px rgba(38,64,139,0.16);
}
.quiz-hero-icon .material-symbols-outlined {
    font-size: 42px;
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 48;
}

.quiz-title {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.06;
    margin: 0;
    color: var(--qz-text);
}
.quiz-title .quiz-title-accent {
    background: linear-gradient(135deg, #26408b 0%, #5b8a93 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quiz-subtitle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--qz-text-sec);
    font-size: 14.5px;
    font-weight: 500;
}
.quiz-subtitle-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--qz-text-ter);
    opacity: 0.6;
}

/* Stats grid */
.quiz-meta-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
    margin-bottom: 52px;
    width: 100%;
    max-width: 380px;
}
.quiz-meta-pill {
    background: var(--qz-card-bg);
    border: 1px solid var(--qz-card-border);
    border-radius: var(--qz-r-inner);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 1px 2px rgba(15,23,42,0.03);
    transition: transform 0.18s, box-shadow 0.18s;
}
.quiz-meta-pill:hover {
    transform: translateY(-2px);
    box-shadow: var(--qz-card-shadow);
}
.qmp-num {
    font-size: 24px;
    font-weight: 800;
    color: var(--qz-text);
    line-height: 1;
    letter-spacing: -0.4px;
    font-feature-settings: 'tnum' 1;
}
.qmp-lbl {
    font-size: 10px;
    font-weight: 700;
    color: var(--qz-text-ter);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* CTA */
.quiz-start-btn {
    background: linear-gradient(145deg, #2c4eaa 0%, #1a2d66 100%);
    color: #fff;
    border: none;
    border-radius: var(--qz-r-pill);
    padding: 16px 52px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: -0.1px;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.14) inset,
        0 5px 18px rgba(38,64,139,0.28);
    transition: transform 0.14s, box-shadow 0.14s, filter 0.14s;
    width: 100%;
    max-width: 300px;
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.quiz-start-btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.16) inset,
        0 8px 24px rgba(38,64,139,0.34);
}
.quiz-start-btn:active { transform: scale(0.98); }
.quiz-start-btn .material-symbols-outlined { font-size: 19px; }

.quiz-back-link {
    font-size: 13px;
    color: var(--qz-text-ter);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.quiz-back-link:hover { color: var(--qz-brand); }


/* ════════════════════════════════════════
   QUESTION SCREEN — two-column viewport fit
════════════════════════════════════════ */
#screenQuestion {
    height: calc(100vh - 56px);  /* exact fit, no page scroll */
    flex-direction: column;
    overflow: hidden;
    gap: 0;
    padding: 0;
}

/* ── Status bar ── */
.quiz-status-bar {
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--qz-card-border);
    background: var(--qz-bg);
    gap: 12px;
}

.quiz-exit-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--qz-card-bg);
    border: 1px solid var(--qz-card-border);
    color: var(--qz-text-sec);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.14s, color 0.14s, border-color 0.14s;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}
.quiz-exit-btn:hover { background: var(--qz-card-hover); color: var(--qz-text); }
.quiz-exit-btn:active { transform: scale(0.94); }

.quiz-progress-dots {
    display: flex;
    gap: 5px;
    align-items: center;
    flex: 1;
    justify-content: center;
}
.qpd-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(15,23,42,0.10);
    transition: background 0.28s, transform 0.28s, box-shadow 0.28s;
}
.qpd-dot.qpd-done    { background: var(--qz-brand); }
.qpd-dot.qpd-current {
    background: var(--qz-brand-deep);
    transform: scale(1.4);
    box-shadow: 0 0 0 3px rgba(15,8,75,0.10);
}

.quiz-score-badge {
    min-width: 52px;
    height: 34px;
    border-radius: var(--qz-r-pill);
    background: var(--qz-card-bg);
    border: 1px solid var(--qz-card-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
    color: var(--qz-text);
    padding: 0 13px 0 10px;
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), background 0.2s;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04);
    font-feature-settings: 'tnum' 1;
    flex-shrink: 0;
}
.quiz-score-badge::before {
    content: '★';
    font-size: 11px;
    color: var(--qz-amber);
    line-height: 1;
}
.quiz-score-badge.badge-bump {
    transform: scale(1.18);
    background: var(--qz-amber-bg);
}

/* ── Two-column grid ── */
.quiz-two-col {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 56fr 44fr;
    gap: 12px;
    padding: 14px 20px 16px;
}

/* ── ECG column ── */
.quiz-ecg-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.quiz-ecg-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--qz-card-bg);
    border: 1px solid var(--qz-card-border);
    border-radius: var(--qz-r-card);
    box-shadow: var(--qz-card-shadow);
    overflow: hidden;
}

/* ECG card header */
.quiz-ecg-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(15,23,42,0.05);
}

.quiz-ecg-lead {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    color: var(--qz-text-sec);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.quiz-ecg-lead-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--qz-green);
    box-shadow: 0 0 0 3px rgba(22,163,74,0.15);
    animation: livePulse 2.2s ease-in-out infinite;
}
@keyframes livePulse {
    0%,100% { box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
    50%     { box-shadow: 0 0 0 6px rgba(22,163,74,0.05); }
}

/* Lead selector pills — same .player-lead-pill styling as the simulator/player.
   Hidden when empty so the row collapses for single-lead clips. Also hide the
   static lead label when pills are present (the active pill shows the lead). */
.quiz-hdr-leads {
    border-radius: 10px;
    margin-left: 4px;
    flex-wrap: wrap;
    row-gap: 2px;
}
.quiz-hdr-leads:empty { display: none !important; }
.quiz-ecg-header:has(.quiz-hdr-leads:not(:empty)) .quiz-ecg-lead {
    display: none;
}

/* Tool buttons group */
.quiz-ecg-tools {
    display: flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
}
.quiz-tool-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid var(--qz-card-border);
    background: transparent;
    color: var(--qz-text-ter);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.quiz-tool-btn:hover {
    background: var(--qz-brand-soft);
    color: var(--qz-brand);
    border-color: rgba(38,64,139,0.20);
}
.quiz-tool-btn.tool-active {
    background: var(--qz-brand);
    color: #fff;
    border-color: var(--qz-brand);
}
.quiz-tool-btn .material-symbols-outlined {
    font-size: 15px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.quiz-tool-btn.tool-active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Tool separator */
.quiz-tool-sep {
    width: 1px;
    height: 14px;
    background: var(--qz-card-border);
    margin: 0 2px;
}

.quiz-ecg-meta {
    font-size: 10px;
    font-weight: 600;
    color: var(--qz-text-ter);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-left: 6px;
    white-space: nowrap;
}

/* ── Heart-rate badge ────────────────────────────────────────────────────────
   Glowing pulse-pill that displays detected BPM (Pan-Tompkins). The heart icon
   pulses in sync with the actual BPM via --hr-pulse-period (60 / bpm seconds).
   data-state controls the color tier:
     empty  → neutral grey, no pulse
     normal → mint/teal-green (60–100 bpm)
     brady  → amber (< 60 bpm)
     tachy  → red    (> 100 bpm)
*/
.quiz-ecg-hr {
    --hr-pulse-period: 0.857s;       /* default = 70 bpm before detection */
    --hr-color:        #94a3b8;
    --hr-color-soft:   rgba(148,163,184,0.15);
    --hr-glow:         rgba(148,163,184,0.0);

    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px 5px 9px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(248,250,252,0.85) 100%);
    border: 1px solid var(--hr-color-soft);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.9),
        0 1px 3px rgba(15,23,42,0.04),
        0 0 0 0 var(--hr-glow);
    transition: border-color 0.4s, box-shadow 0.4s;
    margin-left: 4px;
}
.quiz-hr-icon {
    width: 16px;
    height: 16px;
    color: var(--hr-color);
    flex-shrink: 0;
    animation: qzHrBeat var(--hr-pulse-period) ease-in-out infinite;
    transform-origin: center;
    filter: drop-shadow(0 0 4px var(--hr-glow));
    transition: color 0.4s;
}
.quiz-ecg-hr[data-state="empty"] .quiz-hr-icon {
    animation: none;
    opacity: 0.5;
}
.quiz-hr-text {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
    line-height: 1;
    font-feature-settings: 'tnum';
}
.quiz-hr-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--hr-color);
    letter-spacing: -0.01em;
    transition: color 0.4s;
    min-width: 18px;
    text-align: right;
}
.quiz-hr-unit {
    font-size: 9px;
    font-weight: 700;
    color: var(--hr-color);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.75;
    transition: color 0.4s;
}

/* Color tiers */
.quiz-ecg-hr[data-state="normal"] {
    --hr-color:      #047857;       /* emerald-700 */
    --hr-color-soft: rgba(4,120,87,0.18);
    --hr-glow:       rgba(16,185,129,0.30);
}
.quiz-ecg-hr[data-state="brady"] {
    --hr-color:      #b45309;       /* amber-700 */
    --hr-color-soft: rgba(180,83,9,0.20);
    --hr-glow:       rgba(245,158,11,0.30);
}
.quiz-ecg-hr[data-state="tachy"] {
    --hr-color:      #b91c1c;       /* red-700 */
    --hr-color-soft: rgba(185,28,28,0.22);
    --hr-glow:       rgba(239,68,68,0.32);
}

@keyframes qzHrBeat {
    0%   { transform: scale(1);    }
    18%  { transform: scale(1.22); }
    32%  { transform: scale(1);    }
    44%  { transform: scale(1.10); }
    60%  { transform: scale(1);    }
    100% { transform: scale(1);    }
}

/* Hide on extra-narrow screens to keep header from wrapping */
@media (max-width: 720px) {
    .quiz-ecg-hr { display: none; }
}

/* ECG canvas stack — bg grid · trace · caliper overlay · magnifier overlay */
.quiz-ecg-canvas-wrap {
    flex: 1;
    min-height: 0;
    position: relative;
    background: #ffffff;
    overflow: hidden;
}
.quiz-ecg-canvas-wrap canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
#quizBgCanvas        { z-index: 1; }
#quizTraceCanvas     { z-index: 2; pointer-events: none; }
#quizCaliperCanvas   { z-index: 3; pointer-events: none; }   /* CaliperTool re-enables when active */
#quizMagnifierCanvas { z-index: 4; pointer-events: none; }   /* MagnifierTool listens on parent */

/* Trace fades in once it's been drawn */
#quizTraceCanvas {
    opacity: 0;
    transition: opacity 0.4s ease;
}
.quiz-ecg-canvas-wrap.ecg-ready #quizTraceCanvas { opacity: 1; }

/* Skeleton (sits above canvases until ready) */
.quiz-ecg-skeleton {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: linear-gradient(90deg, #f1f4f9 25%, #e7ebf1 50%, #f1f4f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Error state — replaces the shimmer when fetchSignal throws or returns empty */
.quiz-ecg-skeleton.skeleton-error {
    background: #fef6f6;
    animation: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.quiz-ecg-skeleton.skeleton-error:hover {
    background: #fceeee;
}
.skeleton-error-inner {
    text-align: center;
    color: #b3261e;
    user-select: none;
}
.skeleton-error-inner .material-symbols-outlined {
    font-size: 36px;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 36;
    color: #b3261e;
    margin-bottom: 4px;
}
.skeleton-error-msg {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 2px;
}
.skeleton-error-hint {
    font-size: 12px;
    font-weight: 500;
    color: #8a3a36;
    opacity: 0.8;
}

/* ECG footer */
.quiz-ecg-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px 11px;
    flex-shrink: 0;
    border-top: 1px solid rgba(15,23,42,0.05);
}
.quiz-ecg-foot-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--qz-text-ter);
    letter-spacing: 0.02em;
}
.quiz-ecg-foot-tip {
    font-size: 10.5px;
    font-weight: 500;
    color: var(--qz-text-ter);
    letter-spacing: 0;
}

/* ── Question column ── */
.quiz-q-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(15,23,42,0.12) transparent;
    gap: 0;
}

.quiz-q-card {
    background: var(--qz-card-bg);
    border: 1px solid var(--qz-card-border);
    border-radius: var(--qz-r-card);
    box-shadow: var(--qz-card-shadow);
    padding: 22px 22px 20px;
    display: flex;
    flex-direction: column;
}

.quiz-q-area {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Question meta row */
.quiz-q-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}
.quiz-q-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--qz-text-ter);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* Diff badge */
.quiz-diff-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    border-radius: var(--qz-r-pill);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    white-space: nowrap;
}
.quiz-diff-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.diff-1 { background: rgba(22,163,74,0.10);  color: #15803d; }
.diff-2 { background: rgba(217,119,6,0.10);  color: #b45309; }
.diff-3 { background: rgba(220,38,38,0.09);  color: #b91c1c; }

/* Question text */
.quiz-q-text {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.35px;
    color: var(--qz-text);
    margin-bottom: 18px;
}

/* Choices */
.quiz-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.quiz-choice-btn {
    width: 100%;
    background: var(--qz-card-soft);
    border: 1.5px solid transparent;
    border-radius: var(--qz-r-inner);
    padding: 13px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: var(--qz-text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    transition: background 0.14s, border-color 0.14s, transform 0.1s, box-shadow 0.14s;
}
.quiz-choice-btn:not(:disabled):hover {
    background: #fff;
    border-color: var(--qz-card-border-2);
    box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 4px 12px -4px rgba(15,23,42,0.10);
    transform: translateY(-1px);
}
.quiz-choice-btn:not(:disabled):active { transform: scale(0.99); }
.quiz-choice-btn:disabled { cursor: default; }

.qcb-letter {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid var(--qz-card-border-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--qz-text-sec);
    flex-shrink: 0;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.qcb-text { flex: 1; }
.qcb-tick {
    flex-shrink: 0;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.quiz-choice-btn.qcb-correct .qcb-tick,
.quiz-choice-btn.qcb-wrong   .qcb-tick {
    opacity: 1; transform: scale(1);
}

/* Correct */
.quiz-choice-btn.qcb-correct {
    background: var(--qz-green-bg);
    border-color: var(--qz-green-border);
    animation: correctPulse 0.38s ease forwards;
}
.quiz-choice-btn.qcb-correct .qcb-letter {
    background: rgba(22,163,74,0.12);
    border-color: rgba(22,163,74,0.40);
    color: var(--qz-green);
}
.quiz-choice-btn.qcb-correct .qcb-tick { color: var(--qz-green); }

@keyframes correctPulse {
    0%  { transform: scale(1);     }
    40% { transform: scale(1.012); }
    100%{ transform: scale(1);     }
}

/* Wrong */
.quiz-choice-btn.qcb-wrong {
    background: var(--qz-red-bg);
    border-color: var(--qz-red-border);
    animation: wrongShake 0.4s ease;
}
.quiz-choice-btn.qcb-wrong .qcb-letter {
    background: rgba(220,38,38,0.10);
    border-color: rgba(220,38,38,0.38);
    color: var(--qz-red);
}
.quiz-choice-btn.qcb-wrong .qcb-tick { color: var(--qz-red); }

/* ─── Soft rule-out state (struck through, still clickable) ─── */
.quiz-choice-btn.qcb-ruled-out {
    opacity: 0.55;
    filter: grayscale(0.35);
}
.quiz-choice-btn.qcb-ruled-out .qcb-text {
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: rgba(0,0,0,0.4);
}
.quiz-choice-btn.qcb-ruled-out .qcb-letter {
    background: rgba(110,110,110,0.12);
    border-color: rgba(110,110,110,0.25);
    color: #888;
    position: relative;
}
.quiz-choice-btn.qcb-ruled-out .qcb-letter::after {
    content: '✕';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 8px;
    line-height: 1;
    background: #888;
    color: #fff;
    border-radius: 50%;
    width: 11px;
    height: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes wrongShake {
    0%,100% { transform: translateX(0); }
    20%     { transform: translateX(-5px); }
    40%     { transform: translateX(4px);  }
    60%     { transform: translateX(-3px); }
    80%     { transform: translateX(2px);  }
}

/* Teaching panel */
.quiz-teaching {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--qz-card-border);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.28s ease, transform 0.38s cubic-bezier(0.34,1.2,0.64,1);
}
.quiz-teaching.teaching-visible { opacity: 1; transform: translateY(0); }

.quiz-teaching-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.quiz-teaching-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--qz-brand-soft);
    color: var(--qz-brand);
}
.quiz-teaching-icon-wrap .material-symbols-outlined { font-size: 18px; }
.quiz-teaching.teaching-correct .quiz-teaching-icon-wrap {
    background: rgba(22,163,74,0.10); color: var(--qz-green);
}
.quiz-teaching.teaching-wrong .quiz-teaching-icon-wrap {
    background: rgba(220,38,38,0.09); color: var(--qz-red);
}

.quiz-teaching-body { flex: 1; min-width: 0; }
.quiz-teaching-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--qz-text-ter);
    margin-bottom: 4px;
}
.quiz-teaching.teaching-correct .quiz-teaching-label { color: var(--qz-green); }
.quiz-teaching.teaching-wrong   .quiz-teaching-label { color: var(--qz-red); }
.quiz-teaching-text {
    font-size: 13.5px;
    line-height: 1.55;
    color: #475569;
    letter-spacing: -0.1px;
}

.quiz-next-btn {
    width: 100%;
    background: var(--qz-text);
    border: none;
    color: #fff;
    border-radius: var(--qz-r-inner);
    padding: 13px 20px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 14px;
    transition: background 0.14s, transform 0.1s, box-shadow 0.14s;
    letter-spacing: -0.1px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.quiz-next-btn:hover {
    background: #1e293b;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 6px 16px -6px rgba(15,23,42,0.36);
}
.quiz-next-btn:active { transform: scale(0.99); }

/* Question transition */
.quiz-q-area.q-exit { animation: qExit 0.20s ease forwards; }
.quiz-q-area.q-enter { animation: qEnter 0.30s cubic-bezier(0.34,1.1,0.64,1) forwards; }
@keyframes qExit  { to   { opacity: 0; transform: translateX(-10px); } }
@keyframes qEnter { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }


/* ════════════════════════════════════════
   END SCREEN
════════════════════════════════════════ */
#screenEnd {
    max-width: 520px;
    margin: 0 auto;
    padding: 48px 28px 60px;
    min-height: calc(100vh - 56px);
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0;
    animation: heroIn 0.55s cubic-bezier(0.22,1,0.36,1) both;
}

.quiz-end-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
}

.quiz-score-ring {
    position: relative;
    width: 160px;
    height: 160px;
    flex-shrink: 0;
    margin-bottom: 6px;
}
.quiz-score-ring svg { width: 160px; height: 160px; overflow: visible; }
#scoreTrack { stroke: rgba(15,23,42,0.08); }
#scoreArc {
    stroke: var(--qz-brand);
    stroke-dasharray: 326.7;
    stroke-dashoffset: 326.7;
    transition: stroke-dashoffset 1.4s cubic-bezier(0.4,0,0.2,1), stroke 0.4s ease;
    filter: drop-shadow(0 3px 10px rgba(38,64,139,0.22));
}
.score-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}
.score-ring-num {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: -1.4px;
    line-height: 1;
    color: var(--qz-text);
    font-feature-settings: 'tnum' 1;
}
.score-ring-pct {
    font-size: 14px;
    font-weight: 600;
    color: var(--qz-text-sec);
}

.quiz-end-stars {
    font-size: 20px;
    letter-spacing: 4px;
    color: var(--qz-amber);
}
.quiz-end-title {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--qz-text);
    margin: 0;
}
.quiz-end-msg {
    font-size: 14.5px;
    color: var(--qz-text-sec);
    margin: 2px 0 0;
    max-width: 300px;
    line-height: 1.55;
}

.quiz-end-actions {
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: 100%;
    max-width: 300px;
}
.quiz-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border-radius: var(--qz-r-pill);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: transform 0.12s, box-shadow 0.14s, filter 0.14s;
    letter-spacing: -0.1px;
}
.quiz-action-btn:hover  { transform: translateY(-1px); }
.quiz-action-btn:active { transform: scale(0.98); }

.quiz-action-retry {
    background: linear-gradient(145deg, #2c4eaa, #1a2d66);
    color: #fff;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.14) inset,
        0 5px 16px rgba(38,64,139,0.28);
}
.quiz-action-retry:hover { filter: brightness(1.05); }

.quiz-action-home {
    background: var(--qz-card-bg);
    border: 1.5px solid var(--qz-card-border-2);
    color: var(--qz-text-sec);
}
.quiz-action-home:hover { color: var(--qz-text); border-color: rgba(15,23,42,0.18); }


/* ════════════════════════════════════════
   AI COACH (floating panel, bottom-right)
   Apple-style frosted-glass card that expands from a small pill.
   Lives inside #screenQuestion so it auto-hides on selector / start / end.
════════════════════════════════════════ */

.qz-coach {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 70;
    font-family: 'Inter', system-ui, sans-serif;
    pointer-events: none;       /* let children re-enable interaction */
}
.qz-coach > * { pointer-events: auto; }

/* ── Collapsed pill ── */
.qz-coach-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 16px 0 12px;
    border: 1px solid rgba(15,23,42,0.10);
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff 0%, #f6f8fc 100%);
    color: var(--qz-brand-deep);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.1px;
    cursor: pointer;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.9) inset,
        0 6px 22px rgba(15,23,42,0.10),
        0 2px 6px rgba(15,23,42,0.06);
    transition: transform 0.14s ease, box-shadow 0.18s ease, border-color 0.18s, background 0.2s;
    animation: qzCoachPillIn 0.45s cubic-bezier(0.22,1,0.36,1) both;
}
.qz-coach-pill:hover {
    transform: translateY(-1.5px);
    border-color: rgba(38,64,139,0.28);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.9) inset,
        0 10px 30px rgba(38,64,139,0.18),
        0 4px 10px rgba(15,23,42,0.08);
}
.qz-coach-pill:active { transform: translateY(0); }
.qz-coach-pill-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(135deg, #26408b 0%, #5b8a93 100%);
    color: #fff;
    box-shadow: 0 0 0 0 rgba(91,138,147,0.45);
    animation: qzCoachPillPulse 2.8s ease-in-out infinite;
}
.qz-coach-pill-text { white-space: nowrap; }

@keyframes qzCoachPillIn {
    from { opacity: 0; transform: translateY(8px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes qzCoachPillPulse {
    0%, 100% { box-shadow: 0 0 0 0   rgba(91,138,147,0.45); }
    50%      { box-shadow: 0 0 0 7px rgba(91,138,147,0); }
}

/* Hide the pill once the card is open */
.qz-coach[data-open="true"] .qz-coach-pill { display: none; }

/* ── Expanded card ── */
.qz-coach-card {
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.7) inset,
        0 24px 64px -16px rgba(15,23,42,0.34),
        0 8px 22px -8px rgba(15,23,42,0.22);
    animation: qzCoachCardIn 0.32s cubic-bezier(0.22,1,0.36,1) both;
}
.qz-coach-card[hidden] { display: none; }

@keyframes qzCoachCardIn {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Header ── */
.qz-coach-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px 12px 14px;
    border-bottom: 1px solid rgba(15,23,42,0.06);
    background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 100%);
}
.qz-coach-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.qz-coach-avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: linear-gradient(135deg, #26408b 0%, #5b8a93 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.20) inset,
        0 4px 12px rgba(38,64,139,0.30);
}
.qz-coach-titles { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.qz-coach-title {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--qz-text);
    letter-spacing: -0.1px;
}
.qz-coach-sub {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--qz-text-ter);
    letter-spacing: 0.01em;
}
.qz-coach-close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--qz-text-sec);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.14s, color 0.14s, border-color 0.14s;
}
.qz-coach-close:hover {
    background: rgba(15,23,42,0.06);
    color: var(--qz-text);
    border-color: rgba(15,23,42,0.08);
}

/* ── Disclaimer banner ── */
.qz-coach-disclaimer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 8px 12px 0;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: rgba(217,119,6,0.08);
    color: #b45309;
    border: 1px solid rgba(217,119,6,0.18);
}
.qz-coach-disclaimer .material-symbols-outlined { line-height: 1; }

/* ── Animated waveform (active while Claude is thinking) ── */
.qz-coach-wave {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5px;
    height: 28px;
    margin: 6px 14px 0;
    opacity: 0;
    transform: scaleY(0.6);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.qz-coach-wave > span {
    display: inline-block;
    width: 2.5px;
    height: 4px;
    border-radius: 99px;
    background: linear-gradient(180deg, #5b8a93 0%, #26408b 100%);
    transform-origin: center;
    transition: transform 0.18s ease;
}
/* Active state — shown when data-thinking="true" (Claude generating) */
.qz-coach-card[data-thinking="true"] .qz-coach-wave {
    opacity: 1;
    transform: scaleY(1);
}
.qz-coach-card[data-thinking="true"] .qz-coach-wave > span {
    animation: qzCoachWaveBar 1.05s ease-in-out infinite;
}
/* Stagger 24 bars with distinct peaks and delays for an organic waveform.
   --hmax controls how tall this bar peaks; --d controls the phase offset. */
.qz-coach-wave > span:nth-child(1)  { --hmax: 10px; --d: 0.00s; }
.qz-coach-wave > span:nth-child(2)  { --hmax: 16px; --d: 0.05s; }
.qz-coach-wave > span:nth-child(3)  { --hmax: 22px; --d: 0.10s; }
.qz-coach-wave > span:nth-child(4)  { --hmax: 14px; --d: 0.15s; }
.qz-coach-wave > span:nth-child(5)  { --hmax: 24px; --d: 0.20s; }
.qz-coach-wave > span:nth-child(6)  { --hmax: 18px; --d: 0.25s; }
.qz-coach-wave > span:nth-child(7)  { --hmax: 26px; --d: 0.30s; }
.qz-coach-wave > span:nth-child(8)  { --hmax: 12px; --d: 0.35s; }
.qz-coach-wave > span:nth-child(9)  { --hmax: 20px; --d: 0.40s; }
.qz-coach-wave > span:nth-child(10) { --hmax: 26px; --d: 0.45s; }
.qz-coach-wave > span:nth-child(11) { --hmax: 22px; --d: 0.50s; }
.qz-coach-wave > span:nth-child(12) { --hmax: 28px; --d: 0.55s; }
.qz-coach-wave > span:nth-child(13) { --hmax: 18px; --d: 0.50s; }
.qz-coach-wave > span:nth-child(14) { --hmax: 24px; --d: 0.45s; }
.qz-coach-wave > span:nth-child(15) { --hmax: 14px; --d: 0.40s; }
.qz-coach-wave > span:nth-child(16) { --hmax: 22px; --d: 0.35s; }
.qz-coach-wave > span:nth-child(17) { --hmax: 26px; --d: 0.30s; }
.qz-coach-wave > span:nth-child(18) { --hmax: 18px; --d: 0.25s; }
.qz-coach-wave > span:nth-child(19) { --hmax: 14px; --d: 0.20s; }
.qz-coach-wave > span:nth-child(20) { --hmax: 24px; --d: 0.15s; }
.qz-coach-wave > span:nth-child(21) { --hmax: 12px; --d: 0.10s; }
.qz-coach-wave > span:nth-child(22) { --hmax: 20px; --d: 0.05s; }
.qz-coach-wave > span:nth-child(23) { --hmax: 16px; --d: 0.00s; }
.qz-coach-wave > span:nth-child(24) { --hmax: 8px;  --d: 0.05s; }
.qz-coach-wave > span { animation-delay: var(--d); }

@keyframes qzCoachWaveBar {
    0%, 100% { height: 4px; }
    50%      { height: var(--hmax, 16px); }
}

/* ── Transcript ── */
.qz-coach-transcript {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 14px 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}
.qz-coach-transcript::-webkit-scrollbar { width: 6px; }
.qz-coach-transcript::-webkit-scrollbar-thumb {
    background: rgba(15,23,42,0.15);
    border-radius: 99px;
}

.qz-coach-welcome {
    padding: 14px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(38,64,139,0.06) 0%, rgba(91,138,147,0.06) 100%);
    border: 1px dashed rgba(38,64,139,0.22);
    text-align: center;
}
.qz-coach-welcome-title {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--qz-text);
    margin: 0 0 4px;
    letter-spacing: -0.1px;
}
.qz-coach-welcome-body {
    font-size: 12px;
    color: var(--qz-text-sec);
    line-height: 1.45;
    margin: 0;
}

.qz-coach-msg {
    max-width: 86%;
    padding: 9px 12px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: -0.1px;
    white-space: pre-wrap;
    word-wrap: break-word;
    animation: qzCoachMsgIn 0.28s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes qzCoachMsgIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.qz-coach-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #26408b 0%, #1a2d66 100%);
    color: #fff;
    border-bottom-right-radius: 5px;
    box-shadow: 0 4px 12px rgba(38,64,139,0.18);
}
.qz-coach-msg-bot {
    align-self: flex-start;
    background: rgba(255,255,255,0.85);
    color: var(--qz-text);
    border: 1px solid rgba(15,23,42,0.07);
    border-bottom-left-radius: 5px;
    box-shadow: 0 1px 2px rgba(15,23,42,0.03);
}
.qz-coach-msg-error {
    align-self: stretch;
    text-align: center;
    background: rgba(220,38,38,0.06);
    color: #b91c1c;
    border: 1px solid rgba(220,38,38,0.18);
    font-size: 12px;
    border-radius: 10px;
    padding: 8px 10px;
}

/* Typing-dots indicator (shown while we wait for Claude) */
.qz-coach-typing {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    border-radius: 14px;
    border-bottom-left-radius: 5px;
    background: rgba(255,255,255,0.85);
    border: 1px solid rgba(15,23,42,0.07);
}
.qz-coach-typing > span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--qz-brand);
    opacity: 0.4;
    animation: qzCoachDot 1.2s ease-in-out infinite;
}
.qz-coach-typing > span:nth-child(2) { animation-delay: 0.15s; }
.qz-coach-typing > span:nth-child(3) { animation-delay: 0.30s; }
@keyframes qzCoachDot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.85); }
    40%           { opacity: 1;   transform: scale(1);    }
}

/* ── Input row ── */
.qz-coach-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 10px 12px 10px;
    border-top: 1px solid rgba(15,23,42,0.06);
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.5) 100%);
}

.qz-coach-input {
    flex: 1;
    min-height: 36px;
    max-height: 110px;
    padding: 8px 12px;
    border: 1px solid rgba(15,23,42,0.12);
    border-radius: 14px;
    background: rgba(255,255,255,0.9);
    color: var(--qz-text);
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: border-color 0.14s, box-shadow 0.14s;
}
.qz-coach-input::placeholder { color: var(--qz-text-ter); }
.qz-coach-input:focus {
    border-color: rgba(38,64,139,0.45);
    box-shadow: 0 0 0 3px rgba(38,64,139,0.10);
}
.qz-coach-send {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #26408b 0%, #1a2d66 100%);
    color: #fff;
    cursor: pointer;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.14) inset,
        0 4px 12px rgba(38,64,139,0.30);
    transition: transform 0.12s, box-shadow 0.14s, filter 0.14s, opacity 0.14s;
}
.qz-coach-send:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.18) inset,
        0 6px 18px rgba(38,64,139,0.36);
}
.qz-coach-send:active:not(:disabled) { transform: translateY(0); }
.qz-coach-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}
.qz-coach-send svg { transform: translateX(0.5px); }

/* Hide on small screens — feature requires a comfortable surface area */
@media (max-width: 720px) {
    .qz-coach { display: none; }
}

/* ─── Stage progress strip ─── */
.qz-coach-stages {
    display: flex;
    flex-direction: row;
    gap: 4px;
    padding: 6px 14px 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.qz-coach-stages [data-stage] {
    flex: 1;
    text-align: center;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 3px 4px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.28);
    transition: background 0.2s ease, color 0.2s ease;
    user-select: none;
}
.qz-coach-stages [data-stage].covered {
    background: rgba(99,155,255,0.22);
    color: #a6c8ff;
    box-shadow: inset 0 0 0 1px rgba(99,155,255,0.30);
}

/* ─── System message bubble (rule-out confirmations) ─── */
.qz-coach-msg-system {
    align-self: center;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.02em;
    padding: 2px 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    margin: 4px auto;
}

/* ─── Rule-out confirmation chip ─── */
.qz-coach-ruleout-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 6px 0 2px;
    padding: 8px 10px 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(99,155,255,0.30);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.qzcr-label {
    font-size: 12px;
    color: rgba(255,255,255,0.75);
    flex: 1;
}
.qzcr-label strong {
    color: #a6c8ff;
    font-weight: 700;
}
.qzcr-btns {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.qzcr-yes,
.qzcr-no {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s;
}
.qzcr-yes {
    background: rgba(99,155,255,0.85);
    color: #fff;
}
.qzcr-yes:hover { opacity: 0.85; }
.qzcr-no {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.55);
    border: 1px solid rgba(255,255,255,0.12);
}
.qzcr-no:hover { opacity: 0.75; }


/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 900px) {
    .quiz-two-col {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 10px 14px 14px;
    }
    .quiz-q-card { padding: 18px 18px 16px; }
    .quiz-q-text { font-size: 17px; }
}

@media (max-width: 768px) {
    #screenQuestion {
        height: auto;
        min-height: calc(100vh - 56px);
        overflow: visible;
    }
    .quiz-two-col {
        grid-template-columns: 1fr;
        overflow: visible;
    }
    .quiz-q-col {
        overflow-y: visible;
        max-height: none;
    }
    .quiz-ecg-canvas-wrap {
        height: 220px;
        flex: none;
    }
}

@media (min-width: 1200px) {
    .quiz-two-col {
        grid-template-columns: 58fr 42fr;
        gap: 16px;
        padding: 16px 28px 20px;
    }
    .quiz-q-card { padding: 26px 26px 22px; }
    .quiz-q-text { font-size: 20px; }
    .quiz-choice-btn { font-size: 14.5px; }
}


/* ════════════════════════════════════════
   SELECT SCREEN (quiz chooser)
════════════════════════════════════════ */

#screenSelect {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 24px 60px;
    min-height: calc(100vh - 56px);
    align-items: center;
}

.qsel-header {
    text-align: center;
    margin-bottom: 28px;
    padding-top: 24px;
}

.qsel-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--qz-text);
    margin: 0 0 8px;
}

.qsel-subtitle {
    font-size: 0.9375rem;
    color: var(--qz-text-sec);
    margin: 0;
}

.qsel-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.qsel-loading {
    text-align: center;
    padding: 20px;
    font-size: 0.875rem;
    color: var(--qz-text-ter);
}

.qsel-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--qz-card-bg);
    border: 1px solid var(--qz-card-border);
    border-radius: var(--qz-r-card);
    padding: 20px;
    cursor: pointer;
    transition: box-shadow 0.18s, border-color 0.18s, transform 0.12s;
    box-shadow: var(--qz-card-shadow);
}
.qsel-card:hover {
    border-color: rgba(38,64,139,0.22);
    box-shadow: 0 4px 20px rgba(38,64,139,0.1);
    transform: translateY(-1px);
}
.qsel-card:active { transform: translateY(0); }

.qsel-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 26px;
}
.qsel-icon-practice {
    background: rgba(38,64,139,0.10);
    color: #26408b;
}
.qsel-icon-quiz {
    background: rgba(77,155,123,0.12);
    color: #3a7d62;
}

.qsel-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qsel-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--qz-text);
    margin: 0;
}

.qsel-card-desc {
    font-size: 0.875rem;
    color: var(--qz-text-sec);
    margin: 0;
    line-height: 1.45;
}

.qsel-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.qsel-meta-pill {
    font-size: 0.7125rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 100px;
    background: var(--qz-brand-soft);
    color: var(--qz-brand);
}

.qsel-card-arrow {
    color: var(--qz-text-ter);
    font-size: 22px !important;
    flex-shrink: 0;
    transition: color 0.15s, transform 0.15s;
}
.qsel-card:hover .qsel-card-arrow {
    color: var(--qz-brand);
    transform: translateX(3px);
}

