/**
 * SkyGrammar Quiz — frontend styles.
 */
.sgq {
    --sgq-accent: #4F46E5;
    --sgq-bg: #ffffff;
    --sgq-text: #33333b;
    --sgq-heading: #1b1b1f;
    --sgq-muted: #6b6b76;
    --sgq-border: rgba(20,20,30,.12);
    --sgq-success: #10B981;
    --sgq-danger: #F43F5E;
    background: var(--sgq-bg);
    border: 1px solid var(--sgq-border);
    border-radius: 16px;
    padding: 24px;
    margin: 32px 0;
    box-shadow: 0 6px 24px rgba(20,20,30,.06);
    font-family: inherit;
}

.sgq-head { margin-bottom: 18px; }
.sgq-badge {
    display: inline-block;
    background: var(--sgq-accent);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
}
.sgq-title { margin: 10px 0 2px; font-size: 1.4rem; color: var(--sgq-heading); line-height: 1.2; }
.sgq-sub { margin: 0; color: var(--sgq-muted); font-size: .9rem; }

.sgq-q {
    border: 1px solid var(--sgq-border);
    border-radius: 12px;
    padding: 16px 18px;
    margin: 0 0 14px;
}
.sgq-q-text {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-weight: 600;
    color: var(--sgq-heading);
    font-size: 1.05rem;
    padding: 0;
    margin-bottom: 12px;
}
.sgq-q-num {
    flex: 0 0 auto;
    width: 26px; height: 26px;
    background: var(--sgq-accent);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .82rem;
    font-weight: 700;
}

.sgq-options { display: grid; gap: 8px; }
.sgq-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--sgq-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.sgq-option:hover { border-color: var(--sgq-accent); }
.sgq-option input { position: absolute; opacity: 0; width: 0; height: 0; }
.sgq-option-mark {
    flex: 0 0 auto;
    width: 20px; height: 20px;
    border: 2px solid var(--sgq-border);
    border-radius: 50%;
    position: relative;
    transition: border-color .15s ease;
}
.sgq-option input:checked + .sgq-option-mark {
    border-color: var(--sgq-accent);
}
.sgq-option input:checked + .sgq-option-mark::after {
    content: "";
    position: absolute;
    inset: 3px;
    background: var(--sgq-accent);
    border-radius: 50%;
}
.sgq-option-text { color: var(--sgq-text); }

/* Graded states */
.sgq-option.is-correct {
    border-color: var(--sgq-success);
    background: rgba(16,185,129,.08);
}
.sgq-option.is-correct .sgq-option-mark { border-color: var(--sgq-success); }
.sgq-option.is-correct .sgq-option-mark::after { background: var(--sgq-success); content: ""; position: absolute; inset: 3px; border-radius: 50%; }
.sgq-option.is-wrong {
    border-color: var(--sgq-danger);
    background: rgba(244,63,94,.07);
}
.sgq-option.is-wrong .sgq-option-mark { border-color: var(--sgq-danger); }

.sgq-explain {
    margin: 12px 0 0;
    padding: 10px 12px;
    background: rgba(79,70,229,.06);
    border-left: 3px solid var(--sgq-accent);
    border-radius: 6px;
    font-size: .9rem;
    color: var(--sgq-text);
}

.sgq-actions { margin-top: 6px; }
.sgq-submit, .sgq-retry {
    appearance: none;
    border: none;
    background: var(--sgq-accent);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    transition: filter .15s ease;
}
.sgq-submit:hover, .sgq-retry:hover { filter: brightness(1.08); }
.sgq-retry {
    background: transparent;
    color: var(--sgq-accent);
    border: 1px solid var(--sgq-accent);
}

.sgq-notice {
    color: var(--sgq-danger);
    font-size: .9rem;
    margin: 0 0 10px;
    font-weight: 600;
}

/* Result */
.sgq-result {
    margin-top: 20px;
    padding: 20px;
    border: 1px solid var(--sgq-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 18px;
    background: linear-gradient(135deg, rgba(79,70,229,.05), transparent);
}
.sgq-score-ring {
    --sgq-pct: 0;
    flex: 0 0 auto;
    width: 84px; height: 84px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--sgq-accent) calc(var(--sgq-pct) * 1%), rgba(20,20,30,.1) 0);
}
.sgq-score-ring.is-pass { background: conic-gradient(var(--sgq-success) calc(var(--sgq-pct) * 1%), rgba(20,20,30,.1) 0); }
.sgq-score-ring.is-fail { background: conic-gradient(var(--sgq-danger) calc(var(--sgq-pct) * 1%), rgba(20,20,30,.1) 0); }
.sgq-score-num {
    width: 64px; height: 64px;
    background: var(--sgq-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--sgq-heading);
}
.sgq-result-text { margin: 0; font-size: 1.02rem; color: var(--sgq-heading); font-weight: 600; }

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .sgq {
        --sgq-bg: #181b22;
        --sgq-text: #c7cad1;
        --sgq-heading: #f4f5f7;
        --sgq-muted: #8b8f9a;
        --sgq-border: rgba(255,255,255,.14);
    }
}

@media (max-width: 600px) {
    .sgq { padding: 18px; }
    .sgq-result { flex-direction: column; text-align: center; }
    .sgq-submit, .sgq-retry { width: 100%; }
}
