@font-face { font-family: "PolySans Bulky"; src: url("PolySans-Bulky.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "PolySans Slim"; src: url("PolySans-Slim.woff") format("woff"); font-weight: 400; font-display: swap; }

:root {
  --violet: #5b4bb0;
  --violet-dark: #46388f;
  --violet-soft: #ebe7f6;
  --orange: #e8662f;
  --ink: #1d1d2b;
  --muted: #5d5d6e;
  --line: #d9d5e6;
  --paper: #ffffff;
  --display: "PolySans Bulky", "Helvetica Neue", Arial, sans-serif;
  --body: "PolySans Slim", "Helvetica Neue", Arial, sans-serif;
  --ui: "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.45; }
a { color: var(--violet); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

.eyebrow { font-family: var(--ui); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--violet); margin: 0 0 8px; }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.1; margin: 0; }

/* Abstimmen */
.wrap { max-width: 680px; margin: 0 auto; padding: 32px 16px 48px; }
.wrap h1 { font-size: clamp(30px, 7vw, 44px); margin-bottom: 8px; }
.intro { color: var(--muted); margin: 0 0 28px; }
fieldset { border: 0; padding: 0; margin: 0 0 32px; }
legend { font-family: var(--display); font-weight: 700; font-size: 24px; padding: 0; margin-bottom: 4px; }
.hint { font-family: var(--ui); font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 460px) { .options { grid-template-columns: 1fr; } }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.opt span { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 12px 14px; border: 1px solid var(--line); background: var(--paper); font-size: 17px; transition: background .15s, border-color .15s; }
.opt span::before { content: ""; flex: 0 0 20px; height: 20px; border: 2px solid var(--violet); background: var(--paper); }
.opt input:checked + span { background: var(--violet-soft); border-color: var(--violet); }
.opt input:checked + span::before { background: var(--violet); box-shadow: inset 0 0 0 3px var(--paper); }
.opt input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 28px; border: 0; background: var(--violet); color: #fff; font-family: var(--display); font-weight: 700; font-size: 19px; cursor: pointer; width: 100%; }
.btn:hover { background: var(--violet-dark); }
.btn[disabled] { opacity: .5; cursor: default; }
.error { color: #b3261e; font-family: var(--ui); font-size: 15px; min-height: 22px; margin: 10px 0 0; }
.done { display: none; padding: 28px; background: var(--violet-soft); }
.done h2 { font-size: 30px; margin-bottom: 8px; }
.done p { margin: 0 0 12px; }
.footnote { font-family: var(--ui); font-size: 13px; color: var(--muted); margin-top: 28px; }

/* Ergebnisse */
.results { min-height: 100vh; padding: 28px 40px; display: grid; grid-template-columns: 1fr 1fr 320px; gap: 40px; align-items: start; }
.results.embed { padding: 12px 20px; gap: 28px; grid-template-columns: 1fr 1fr 280px; min-height: 0; }
body:has(.embed) { overflow: hidden; }
.results h2 { font-size: 26px; margin-bottom: 4px; }
.count { font-family: var(--ui); color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 16px; }
.bar .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .val { font-family: var(--display); font-weight: 700; color: var(--violet); }
.bar .track { display: block; grid-column: 1 / -1; height: 12px; background: var(--violet-soft); }
.bar .fill { display: block; height: 100%; width: 0; background: var(--violet); transition: width .6s ease; }
.bar.zero .val { color: var(--muted); }
.embed h2 { font-size: 22px; }
.embed .count { margin-bottom: 10px; font-size: 14px; }
.embed .bars { gap: 4px; }
.embed .bar { font-size: 15px; line-height: 1.25; }
.embed .bar .track { height: 8px; }
.embed .join { top: 16px; position: static; }
.embed .join h2 { font-size: 20px; }
.embed .total { font-size: 40px; margin-top: 12px; }
.embed .join .url { font-size: 15px; margin-top: 8px; }
.join { text-align: center; position: sticky; top: 28px; }
.join h2 { font-size: 22px; margin-bottom: 12px; }
.qr { background: #fff; padding: 10px; border: 1px solid var(--line); display: inline-block; }
.qr img, .qr svg { display: block; width: 100%; height: auto; }
.join .url { font-family: var(--ui); font-size: 14px; margin-top: 10px; word-break: break-all; color: var(--ink); }
.total { font-family: var(--display); font-weight: 700; font-size: 56px; color: var(--violet); line-height: 1; margin-top: 18px; }
.total small { display: block; font-family: var(--ui); font-weight: 400; font-size: 14px; color: var(--muted); margin-top: 6px; }
.timer { margin-top: 16px; width: 100%; min-height: 48px; border: 2px solid var(--violet); background: var(--paper); color: var(--violet); font-family: var(--display); font-weight: 700; font-size: 17px; cursor: pointer; }
.timer:hover { background: var(--violet-soft); }
.timer--run { background: var(--violet); color: #fff; font-size: 30px; font-variant-numeric: tabular-nums; }
.timer--run:hover { background: var(--violet-dark); }
.timer--last { background: var(--orange); border-color: var(--orange); }
.timer--done { background: var(--orange); border-color: var(--orange); color: #fff; }
.embed .timer { margin-top: 10px; min-height: 44px; }
.embed .timer--run { font-size: 26px; }
.embed .qr { width: min(100%, 34vh); padding: 8px; }
.embed .join h2 { margin-bottom: 8px; }
.embed .total { font-size: 34px; margin-top: 8px; }
.embed .total small { margin-top: 2px; }
@media (max-width: 900px) {
  .results, .results.embed { grid-template-columns: 1fr; padding: 24px 16px; }
  .join { position: static; order: -1; }
  .qr { max-width: 200px; }
}
