/* quiz-forge — one small stylesheet, light and dark. */
:root {
  --bg: #f7f6f2; --surface: #ffffff; --text: #1d1d1f; --muted: #6b6b70; --line: #e3e1da;
  --accent: #2f5bd3; --accent-text: #ffffff; --ok: #1f7a46; --warn: #a45d00; --bad: #b42318;
  --ok-bg: #e6f4ea; --warn-bg: #fdf1df; --bad-bg: #fde8e6; --chip: #efede6;
  --radius: 10px; --gap: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 16px; line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416; --surface: #1d1d20; --text: #ececee; --muted: #9a9aa2; --line: #2e2e33;
    --accent: #7c9cff; --accent-text: #0b0b0c; --ok: #6fd39a; --warn: #f0b35c; --bad: #ff8a80;
    --ok-bg: #16301f; --warn-bg: #33270f; --bad-bg: #3a1714; --chip: #2a2a2f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
header.top { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .brand { font-weight: 700; text-decoration: none; color: var(--text); margin-right: 8px; }
header.top nav { display: flex; flex-wrap: wrap; gap: 4px 14px; flex: 1; }
header.top nav a { text-decoration: none; color: var(--muted); }
header.top nav a.on, header.top nav a:hover { color: var(--text); }
header.top .me { color: var(--muted); font-size: 14px; display: flex; gap: 8px; align-items: center; }
main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 60px; }
main.narrow { max-width: 640px; }
h1 { font-size: 26px; margin: 0 0 12px; } h2 { font-size: 20px; margin: 28px 0 10px; } h3 { font-size: 17px; margin: 18px 0 8px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--gap); }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--chip); font-size: 13px; color: var(--muted); }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.badge.voting { background: var(--warn-bg); color: var(--warn); }
.badge.accepted, .badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.rejected, .badge.wrong, .badge.doubtful { background: var(--bad-bg); color: var(--bad); }
.badge.retired, .badge.unverifiable, .badge.time_sensitive, .badge.flagged { background: var(--chip); color: var(--muted); }
.notice { background: var(--ok-bg); color: var(--ok); padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; }
.error, .errors { color: var(--bad); }
.errors { background: var(--bad-bg); padding: 10px 14px; border-radius: var(--radius); }
.warnbox { background: var(--warn-bg); color: var(--warn); padding: 10px 14px; border-radius: var(--radius); }
.prompt { font-size: 18px; font-weight: 600; margin: 4px 0; }
details > summary { cursor: pointer; color: var(--accent); }
details.answer { margin: 6px 0; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
del { background: var(--bad-bg); color: var(--bad); text-decoration: line-through; }
ins { background: var(--ok-bg); color: var(--ok); text-decoration: none; }
form.stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
label .hint { font-weight: 400; color: var(--muted); }
input[type=text], input[type=number], input[type=date], input:not([type]), select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%;
}
textarea { min-height: 70px; resize: vertical; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; min-height: 360px; }
.inline { display: inline; }
button, .button { font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; padding: 7px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { color: var(--bad); }
button.small, .button.small { padding: 3px 10px; font-size: 14px; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 12px; }
.qlist .card { display: grid; gap: 4px; }
.slot { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; }
.slot .n { font-weight: 700; color: var(--muted); }
.slot.locked { border-left: 3px solid var(--accent); }
.slot.empty { border-style: dashed; }
.media img { max-width: 100%; max-height: 360px; border-radius: 8px; display: block; margin: 6px 0; }
.stat { font-size: 28px; font-weight: 700; }
@media (max-width: 600px) { .slot { grid-template-columns: 28px 1fr; } .slot .actions { grid-column: 2; } }

/* Print views */
body.print { background: #fff; color: #000; font-size: 13pt; }
body.print main { max-width: none; padding: 0 12mm; }
.print .round { page-break-after: always; }
.print .round:last-child { page-break-after: auto; }
.print .q { padding: 6px 0; border-bottom: 1px solid #ccc; page-break-inside: avoid; }
.print .answer { font-weight: 700; }
.print .line { border-bottom: 1px solid #000; height: 11mm; display: flex; align-items: flex-end; gap: 8px; }
.print .pic { display: inline-block; width: 48%; vertical-align: top; margin: 0 1% 12px; page-break-inside: avoid; }
.print .pic img { width: 100%; max-height: 110mm; object-fit: contain; }
.print .noprint { margin: 10px 0; }
@media print { .noprint { display: none !important; } }
/* Presenter */
body.present { background: #000; color: #fff; }
.present main { max-width: 1100px; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
.present .big { font-size: 44px; font-weight: 700; line-height: 1.25; }
.present .nav { display: flex; gap: 12px; margin-top: 30px; }
.present a { color: #9bb5ff; }
.present details summary { color: #9bb5ff; font-size: 22px; margin-top: 24px; }
.present .ans { font-size: 36px; color: #6fd39a; }
