/* Quizora — original responsive interface. No external assets or framework. */
:root {
    color-scheme: light;
    --bg: #f6f7fc;
    --card: #ffffff;
    --ink: #15213b;
    --muted: #60708a;
    --line: #e2e6f1;
    --brand: #5c48c7;
    --brand2: #715bd9;
    --tint: #eeeaff;
    --good: #177547;
    --bad: #b1334e;
    --shadow: 0 12px 34px rgb(29 39 81 / 5%);
    font-synthesis: none;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.65 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
body.dark {
    color-scheme: dark;
    --bg: #10172a;
    --card: #18223a;
    --ink: #f2f4ff;
    --muted: #b2bdd5;
    --line: #303d5c;
    --brand: #b2a5ff;
    --brand2: #c2b8ff;
    --tint: #302950;
    --good: #78dba6;
    --bad: #ff9daf;
    --shadow: 0 12px 34px rgb(0 0 0 / 10%);
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #9581f0; outline-offset: 4px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1.12; letter-spacing: -.045em; margin-bottom: 18px; }
h2 { font-size: 1.45rem; line-height: 1.25; letter-spacing: -.025em; }
h3 { font-size: 1.12rem; line-height: 1.4; }
p { margin-bottom: 18px; }
small { font-size: .8rem; }
code { font: .88em ui-monospace, SFMono-Regular, Consolas, monospace; padding: 2px 5px; background: var(--tint); border-radius: 4px; }
.topbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px max(24px, calc((100% - 1180px) / 2));
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 21px; font-weight: 820; letter-spacing: -.04em; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-mark, .brand-image { width: 40px; height: 40px; border-radius: 12px; }
.brand-mark { display: grid; place-items: center; color: white; background: linear-gradient(135deg, #6652d9, #846cf2); font-size: 25px; font-weight: 900; box-shadow: 0 5px 14px #6657d92b; }
nav, .studio-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; }
nav a { color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
nav a:hover, nav a[aria-current="page"] { color: var(--brand); }
nav form { margin: 0; }
nav button { font-size: 13px; }
.theme { border: 1px solid var(--line); background: var(--bg); color: var(--ink); padding: 7px 10px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.container { max-width: 1180px; margin: auto; padding: 42px 24px 80px; }
.hero {
    position: relative;
    overflow: hidden;
    padding: 48px;
    margin: 0 0 30px;
    border: 1px solid #dfdaf5;
    border-radius: 28px;
    background: radial-gradient(ellipse at 100% 0, #e8e0ff 0, transparent 60%), linear-gradient(120deg, #ffffff 10%, #f2efff);
}
.hero::after { content: "Q"; position: absolute; right: 42px; top: -54px; z-index: 0; color: #8673de12; font-size: 390px; font-weight: 900; line-height: 1.2; transform: rotate(-13deg); pointer-events: none; }
.hero > * { position: relative; z-index: 1; max-width: 680px; }
.hero h1 { max-width: 670px; margin-bottom: 18px; }
.hero p { max-width: 540px; font-size: 16px; color: var(--muted); }
.hero em { font-style: normal; color: var(--brand); }
.dark .hero { border-color: var(--line); background: radial-gradient(ellipse at 100% 0, #392d66 0, transparent 65%), linear-gradient(120deg, #19243d, #252343); }
.dark .hero::after { color: #c0adff12; }
.eyebrow { color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; }
.muted, .hint, .field-help { color: var(--muted); }
.hint, .field-help { font-size: .82rem; font-weight: 450; }
.field-help { display: block; margin: 6px 0 14px; }
.search { display: flex; gap: 9px; max-width: 610px; margin-top: 25px; }
.search input { min-width: 0; flex: 1; margin: 0; background: var(--card); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.quiz-card, .card, .review { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); min-width: 0; }
.quiz-card { position: relative; overflow: hidden; display: flex; flex-direction: column; transition: transform .18s ease, box-shadow .18s ease; }
.quiz-card:hover { transform: translateY(-3px); box-shadow: 0 18px 35px rgb(29 39 81 / 9%); }
.card-accent { height: 5px; position: absolute; left: 0; right: 0; top: 0; }
.quiz-card h2 { font-size: 22px; line-height: 1.3; margin: 20px 0 10px; }
.quiz-card p { color: var(--muted); flex: 1; font-size: 14px; }
.quiz-card .button { align-self: flex-start; }
.pill, .badge, .chip { display: inline-flex; align-items: center; width: fit-content; gap: 6px; background: var(--tint); color: var(--brand); padding: 5px 11px; border-radius: 99px; font-size: 11px; font-weight: 750; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 28px; }
.chip { background: var(--card); border: 1px solid var(--line); color: var(--muted); padding: 8px 13px; font-size: 12px; }
.chip:hover, .chip.active, .chip[aria-current="page"] { background: var(--tint); border-color: #bfb1f1; color: var(--brand); text-decoration: none; }
.meta { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 7px; font-size: 11px; color: var(--muted); padding: 15px 0; border-top: 1px solid var(--line); margin-top: 5px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; border: 1px solid transparent; border-radius: 11px; padding: 10px 18px; background: linear-gradient(135deg, #5c48c7, #7058d1); color: #fff; font-weight: 750; font-size: 13px; line-height: 1.6; cursor: pointer; box-shadow: 0 5px 12px #5c48c71c; text-align: center; }
.button:hover { filter: brightness(1.07); text-decoration: none; }
.button.secondary { background: var(--card); border-color: var(--line); color: var(--ink); box-shadow: none; }
.button.small { min-height: 34px; padding: 6px 12px; font-size: 12px; }
.button:disabled, button:disabled { cursor: not-allowed; opacity: .55; }
.wide { width: 100%; }
label { display: block; margin: 15px 0; font-size: 13px; font-weight: 700; }
input, textarea, select { display: block; width: 100%; padding: 11px 12px; margin-top: 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-size: 14px; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #7a879e; opacity: 1; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: #6952d1; display: inline-block; margin: 0; flex-shrink: 0; }
input[type="color"] { min-height: 46px; padding: 5px; width: 90px; }
input[type="file"] { max-width: 100%; font-size: 12px; }
textarea { min-height: 104px; resize: vertical; }
fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
fieldset:disabled { opacity: .72; }
fieldset:disabled a { pointer-events: auto; }
.auth { max-width: 470px; margin: 28px auto; padding: 36px; }
.auth h1 { font-size: 2.3rem; }
.narrow { max-width: 680px; margin: 24px auto; }
.flash, .callout, .notice, .demo-banner { border: 1px solid #d5e9db; padding: 14px 18px; margin-bottom: 22px; border-radius: 12px; background: #edf9f1; color: #225e3c; font-size: 13px; }
.flash.error { background: #fff0f2; border-color: #f2d0d8; color: #972a44; }
.callout, .notice, .demo-banner { background: var(--tint); border-color: #dcd4f6; color: var(--brand); }
.demo-banner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.dark .flash { background: #173a30; border-color: #2b5b48; color: #a1e2b9; }
.dark .flash.error { background: #452a38; border-color: #714455; color: #ffc3cf; }
.dark .callout, .dark .notice, .dark .demo-banner { border-color: #504575; }
.page-title { margin: 8px 0 30px; }
.page-title h1 { font-size: clamp(2rem, 4vw, 3rem); }
.page-title p { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 24px 0; }
.stats > div, .stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: var(--shadow); }
.stats b, .stats strong, .stats span { display: block; }
.stats b, .stats strong { font-size: 30px; line-height: 1.2; letter-spacing: -.04em; margin-bottom: 6px; }
.stats span { font-size: 12px; color: var(--muted); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 22px; align-items: start; }
.form-grid, .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid label { margin: 0; }
.card-header, .action-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.card-header h2 { margin-bottom: 0; }
.list-row, .question-admin { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 17px 0; }
.list-row:last-child, .question-admin:last-child { border-bottom: 0; }
.list-row small, .question-admin small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.list-row b, .question-admin b { font-size: 13px; }
.list-link { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 650; }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; font-size: 12px; }
.row-actions form, .inline-form { margin: 0; }
.link-button { display: inline; border: 0; background: none; color: var(--brand); font: inherit; font-size: 12px; cursor: pointer; padding: 0; text-align: left; }
.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.danger { color: var(--bad); }
.danger-bg, .button.danger-bg { color: #fff; background: #a8304b; }
.check { display: flex; align-items: flex-start; gap: 9px; font-weight: 500; }
.check input { margin-top: 5px; }
.quiz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; margin-bottom: 30px; }
.quiz-head h1 { margin: 16px 0; font-size: clamp(2rem, 3.8vw, 3rem); }
.quiz-head p { color: var(--muted); max-width: 670px; }
.quiz-detail { padding: 32px; }
.quiz-form { max-width: 850px; margin: 0 auto; }
.question { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; margin: 0 0 22px; box-shadow: var(--shadow); }
.question legend { display: block; float: left; width: 100%; padding: 0 0 16px; font-size: 18px; line-height: 1.5; font-weight: 750; }
.question legend + * { clear: both; }
.question legend span { display: inline-flex; align-items: center; justify-content: center; width: 29px; height: 29px; margin-right: 10px; border-radius: 8px; background: var(--tint); color: var(--brand); font-size: 12px; vertical-align: middle; }
.option { display: flex; align-items: center; gap: 12px; padding: 12px 15px; margin: 10px 0; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; font-size: 14px; font-weight: 450; transition: background .15s ease, border-color .15s ease; }
.option:hover { background: var(--bg); border-color: #bdb0ea; }
.option:has(input:checked) { background: var(--tint); border-color: #9987e0; }
.option input { margin: 0; }
.timer { min-width: 112px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--brand); font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 800; text-align: center; white-space: nowrap; }
.progress { padding: 10px 0; color: var(--muted); font-size: 12px; }
.nickname { max-width: 440px; }
.result-hero { padding: 20px 0 40px; text-align: center; }
.result-hero h1 { max-width: 800px; margin-left: auto; margin-right: auto; }
.score-ring { width: 170px; height: 170px; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 12px solid #ded8f6; border-top-color: #7762d3; border-radius: 50%; margin: 28px auto; background: var(--card); }
.score-ring strong { font-size: 38px; line-height: 1.2; letter-spacing: -.05em; }
.score-ring span { color: var(--muted); font-size: 12px; }
.review { margin: 16px 0; border-left: 4px solid #268d5b; }
.review.wrong { border-left-color: #bf4860; }
.review p:last-child { margin-bottom: 0; }
.review h3 { margin-bottom: 12px; }
.table-wrap { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 15px; background: var(--card); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-wrap th, .table-wrap td { text-align: left; padding: 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table-wrap th { background: var(--bg); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap tr:hover td { background: color-mix(in srgb, var(--bg) 55%, transparent); }
.table-wrap td form { margin: 0; }
footer { padding: 28px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; text-align: center; }
footer a { margin-left: 8px; }
.empty { padding: 36px; color: var(--muted); background: var(--card); border: 1px dashed var(--line); border-radius: 16px; grid-column: 1 / -1; text-align: center; }
.inline-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.inline-form label { margin: 0; flex: 1; min-width: 160px; }
.inline-form .check { flex: none; }
.inline-form .check input { margin-top: 5px; }
.skip-link { position: fixed; left: 12px; top: -70px; z-index: 100; padding: 10px 16px; border-radius: 8px; background: var(--ink); color: var(--card); }
.skip-link:focus { top: 10px; }
summary { cursor: pointer; color: var(--brand); font-weight: 700; }
details { margin: 16px 0; }
@media (max-width: 1000px) {
    .topbar { padding: 14px 24px; gap: 16px; }
    nav { gap: 14px; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
    .hero { padding: 36px; }
    .hero::after { right: -30px; opacity: .6; }
}
@media (max-width: 760px) {
    .topbar { position: static; align-items: flex-start; flex-direction: column; padding: 16px 20px; gap: 12px; }
    .topbar nav { width: 100%; gap: 12px 16px; }
    nav a { font-size: 12px; }
    .theme { margin-left: auto; padding: 5px 8px; font-size: 11px; }
    .container { padding: 24px 18px 54px; }
    .hero { padding: 28px 24px; border-radius: 22px; margin-bottom: 24px; }
    .hero::after { font-size: 260px; top: 35px; right: -30px; opacity: .5; }
    .hero h1 { font-size: clamp(2.3rem, 8vw, 3.1rem); }
    .hero p { font-size: 14px; }
    .grid, .admin-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
    .quiz-card { padding: 24px; }
    .quiz-card p { min-height: 0; }
    .stats { gap: 9px; }
    .stats > div { padding: 17px 13px; }
    .stats b, .stats strong { font-size: 25px; }
    .stats span { font-size: 10px; }
    .quiz-head { flex-direction: column; gap: 0; }
    .quiz-head .timer { align-self: flex-start; margin-bottom: 16px; }
    .question { padding: 19px; }
    .question legend { font-size: 16px; }
    .card, .review { padding: 23px; }
    .auth { padding: 28px; margin: 12px auto; }
    .list-row, .question-admin { flex-wrap: wrap; }
    .row-actions { justify-content: flex-start; }
    .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
