:root {
  --bg: #f4f1ea; --card: #fffdf8; --ink: #1f2a37; --muted: #6b7280; --line: #e4dfd3;
  --accent: #0f766e; --accent-ink: #fff; --accent-soft: #d9efec; --warn: #b42318; --star: #e0a100;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14181d; --card: #1d232b; --ink: #edf0f3; --muted: #9aa4b1; --line: #2d3540;
    --accent: #2bb3a6; --accent-ink: #06201d; --accent-soft: #1c3b38; --warn: #ff8a7a; --star: #f2c230; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 680px; margin: 0 auto; padding: 20px 16px 80px; }
main.wide { max-width: 920px; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 12px 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; margin: 0 0 10px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.87rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 14px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
label.field { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=password], textarea, select {
  width: 100%; font: inherit; color: inherit; background: var(--bg); border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px 14px; }
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; }
button, .btn { font: inherit; font-weight: 600; cursor: pointer; border-radius: 12px; padding: 12px 18px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.big { width: 100%; font-size: 1.1rem; padding: 16px; }
button.ghost { border-color: transparent; background: transparent; padding: 8px 10px; min-height: 40px; }
button.danger { color: var(--warn); }
button:disabled { opacity: 0.55; cursor: default; }
.error { color: var(--warn); font-weight: 600; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; padding: 3px 10px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); }
.badge.off { background: var(--line); color: var(--muted); }
.req { color: var(--warn); }

/* odpovědi žáků */
.qtext { font-weight: 650; font-size: 1.08rem; margin-bottom: 12px; }
.picks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pick { padding: 0; min-height: 56px; font-size: 1.25rem; }
.pick.emoji { font-size: 1.9rem; }
.pick.star { font-size: 2rem; color: var(--line); border-color: transparent; background: transparent; }
.pick.star.on { color: var(--star); }
.pick.on:not(.star) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pick.emoji.on { background: var(--accent-soft); border-color: var(--accent); transform: scale(1.08); }
.ends { display: flex; justify-content: space-between; margin-top: 6px; }
.opt { display: flex; width: 100%; justify-content: flex-start; text-align: left; margin: 8px 0; font-weight: 500; }
.opt.on { background: var(--accent-soft); border-color: var(--accent); }
.opt .mark { width: 22px; height: 22px; flex: none; border: 2px solid var(--muted); border-radius: 50%; }
.opt.sq .mark { border-radius: 6px; }
.opt.on .mark { background: var(--accent); border-color: var(--accent); }
.center { text-align: center; }
.hero { font-size: 4rem; line-height: 1; margin: 20px 0 8px; }
.codebox { text-transform: uppercase; text-align: center; font-size: 1.7rem !important; letter-spacing: 0.3em;
  font-weight: 700; }

/* výsledky */
.bar { display: grid; grid-template-columns: minmax(70px, 34%) 1fr 44px; gap: 10px; align-items: center; margin: 6px 0; }
.bar .track { background: var(--line); border-radius: 99px; height: 14px; overflow: hidden; }
.bar .fill { background: var(--accent); height: 100%; border-radius: 99px; min-width: 2px; }
.bar .n { text-align: right; font-variant-numeric: tabular-nums; }
.bar .lab { overflow-wrap: anywhere; }
.avg { font-size: 1.9rem; font-weight: 750; line-height: 1; }
.quote { border-left: 3px solid var(--accent); padding: 6px 12px; margin: 8px 0; background: var(--bg);
  border-radius: 0 10px 10px 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.qedit { border: 1.5px dashed var(--line); border-radius: 14px; padding: 14px; margin: 12px 0; }
.qr { background: #fff; padding: 12px; border-radius: 14px; max-width: 300px; margin: 12px auto; }
.qr svg { width: 100%; height: auto; display: block; }
.bigcode { font-size: 2.6rem; font-weight: 800; letter-spacing: 0.2em; }
.addrow button { flex: 1 1 140px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.scroll { overflow-x: auto; }
@media (prefers-reduced-motion: no-preference) { .pick, .opt { transition: transform .12s, background .12s; } }
