:root {
    --bg: #0b1220;
    --card: #121a2c;
    --text: #e9eefc;
    --muted: #aab6da;
    --line: rgba(255, 255, 255, .12);
    --accent: #5aa7ff;
    --danger: #ff5a77;
    --ok: #34d399;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: linear-gradient(180deg, #07101f, #0b1220);
    color: var(--text);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(7, 16, 31, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

h1 {
    margin: 0 0 4px;
    font-size: 18px;
}

h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

p {
    line-height: 1.5;
}

.muted {
    color: var(--muted);
}

.right {
    text-align: right;
}

.timer {
    font-variant-numeric: tabular-nums;
    font-size: 20px;
    font-weight: 800;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    display: inline-block;
    min-width: 120px;
}

.live {
    margin-top: 6px;
}

.container {
    max-width: 980px;
    margin: 18px auto;
    padding: 0 14px 70px;
}

.card {
    background: rgba(18, 26, 44, .96);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    margin: 14px 0;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}

.grid2 {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 720px) {
    .grid2 {
        grid-template-columns: 1fr;
    }

    .right {
        text-align: left;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
}

label {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

input,
textarea {
    width: 100%;
    padding: 10px 10px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .06);
    color: var(--text);
    outline: none;
}

textarea {
    min-height: 120px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.notice {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .04);
}

.actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    cursor: pointer;
    background: rgba(255, 255, 255, .06);
    color: var(--text);
    font-weight: 700;
}

button:hover {
    filter: brightness(1.08);
}

button.primary {
    background: rgba(90, 167, 255, .18);
    border-color: rgba(90, 167, 255, .45);
}

button.danger {
    background: rgba(255, 90, 119, .18);
    border-color: rgba(255, 90, 119, .45);
}

button.ghost {
    background: transparent;
}

.hidden {
    display: none !important;
}

.sectionHead {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.sep {
    border: none;
    border-top: 1px solid var(--line);
    margin: 18px 0;
}

.mcq {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    margin: 10px 0;
}

.qhead {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.qnum {
    font-weight: 900;
}

.badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
}

.options {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.opt {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .03);
}

.opt input {
    width: auto;
    margin-top: 2px;
}

.resultGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

@media (max-width: 860px) {
    .resultGrid {
        grid-template-columns: 1fr;
    }
}

.pill {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    background: rgba(255, 255, 255, .04);
}

.pill .label {
    color: var(--muted);
    font-size: 12px;
}

.pill .value {
    font-size: 16px;
    font-weight: 900;
    margin-top: 6px;
}

.reviewArea .mcq {
    background: rgba(255, 255, 255, .02);
}

.correct {
    color: var(--ok);
    font-weight: 800;
}

.wrong {
    color: var(--danger);
    font-weight: 800;
}

.footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 14px;
    border-top: 1px solid var(--line);
    background: rgba(7, 16, 31, .92);
    backdrop-filter: blur(10px);
}