:root {
  --bg: #fbf8f3;
  --bg-soft: #f2ece3;
  --card: #ffffff;
  --ink: #221c2b;
  --muted: #645d6e;
  --line: #e6ded2;
  --berry: #8e2c48;
  --berry-ink: #ffffff;
  --berry-soft: #f6e6eb;
  --gold: #d9a441;
  --gold-soft: #fbf0d9;
  --ok: #2f7d5b;
  --bad: #b8513c;
  --a1: #8e2c48; --a2: #2f6f8f; --a3: #c48a1f; --a4: #4f7a4a;
  --shadow: 0 1px 2px rgba(34, 28, 43, .06), 0 10px 28px rgba(34, 28, 43, .08);
  --radius: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15121a; --bg-soft: #1b1722; --card: #221d2b; --ink: #f2eef6; --muted: #aaa2b5; --line: #342d40;
    --berry: #e07a98; --berry-ink: #15121a; --berry-soft: #3a2230; --gold: #ecc06a; --gold-soft: #3a3020;
    --ok: #5fcb98; --bad: #ef8a74;
    --a1: #c2577a; --a2: #4f97b8; --a3: #d6a23e; --a4: #6f9c69;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #15121a; --bg-soft: #1b1722; --card: #221d2b; --ink: #f2eef6; --muted: #aaa2b5; --line: #342d40;
  --berry: #e07a98; --berry-ink: #15121a; --berry-soft: #3a2230; --gold: #ecc06a; --gold-soft: #3a3020;
  --ok: #5fcb98; --bad: #ef8a74; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px; line-height: 1.5;
}
a { color: var(--berry); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 6.5vw, 2.5rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
main { flex: 1; }
.wrap { width: 100%; max-width: 620px; margin: 0 auto; padding: 0 16px; }
.wide .wrap, .wrap.wide { max-width: 980px; }

.testbar { background: var(--gold-soft); font-size: .85rem; text-align: center; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.top { padding: 16px 0; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 750; }
.logo { position: relative; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--berry); }
.logo::after {
  content: ""; position: absolute; right: -3px; top: -3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold); box-shadow: -14px 20px 0 -3px var(--gold);
}
footer { padding: 28px 0 36px; color: var(--muted); font-size: .85rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer a { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.card.soft { background: var(--bg-soft); box-shadow: none; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 160px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.hidden { display: none !important; }
.error { color: var(--bad); font-weight: 600; margin: 0; min-height: 1.2em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; font: inherit;
  font-weight: 700; text-decoration: none; cursor: pointer; color: var(--berry-ink); background: var(--berry);
  border: 0; border-radius: 14px; padding: 12px 18px;
}
.btn.secondary { color: var(--ink); background: var(--card); border: 1px solid var(--line); }
.btn.ghost { color: var(--muted); background: transparent; border: 1px dashed var(--line); font-weight: 600; }
.btn.danger { color: var(--bad); background: transparent; border: 1px solid var(--line); }
.btn.small { min-height: 38px; padding: 6px 12px; font-size: .9rem; border-radius: 10px; }
.btn.big { min-height: 64px; font-size: 1.2rem; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn:focus-visible, .choice:focus-visible, .answer:focus-visible, .tab:focus-visible { outline: 2px solid var(--berry); outline-offset: 2px; }

label.field, p.field { display: block; font-weight: 650; margin: 0 0 6px; }
input[type="text"], input[type="date"], input[type="datetime-local"], input[type="number"], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 11px 13px;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--berry); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { margin-top: 4px; width: 20px; height: 20px; flex: none; }

.hero { padding: 6px 0 10px; }
.hero p { color: var(--muted); font-size: 1.05rem; }
.hero-img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; border-radius: var(--radius); margin: 0 0 16px; background: var(--bg-soft); }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.choice {
  font: inherit; text-align: left; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px 14px; cursor: pointer;
}
.choice strong { display: block; hyphens: manual; overflow-wrap: break-word; }
.choice span { display: block; color: var(--muted); font-size: .85rem; margin-top: 2px; }
.choice[aria-pressed="true"] { border-color: var(--berry); background: var(--berry-soft); box-shadow: inset 0 0 0 1px var(--berry); }
.steps { margin: 0; padding-left: 1.2em; }
.steps li { margin-bottom: 8px; }
details summary { cursor: pointer; font-weight: 650; }

.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--bg-soft); border-radius: 14px; padding: 4px; margin-bottom: 16px; }
.tab { font: inherit; font-size: .95rem; font-weight: 650; color: var(--muted); background: transparent; border: 0; border-radius: 11px; padding: 10px 2px; cursor: pointer; }
.tab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

.qlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.qitem { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.qitem .qtext { font-weight: 650; margin-bottom: 6px; }
.qitem ol { margin: 0 0 8px; padding-left: 1.3em; color: var(--muted); }
.qitem li.right { color: var(--ok); font-weight: 650; }
.qitem .tools { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--gold-soft); color: var(--ink); margin-left: 6px; vertical-align: middle; }
.optrow { display: flex; gap: 8px; align-items: center; }
.optrow input[type="radio"] { width: 22px; height: 22px; flex: none; accent-color: var(--ok); }
.tpl { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.tpl button { font: inherit; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; color: var(--ink); }
.tpl button:hover { border-color: var(--berry); }
.limit { font-size: .9rem; color: var(--muted); }

.qr { display: block; width: min(260px, 70vw); height: auto; margin: 0 auto; background: #fff; border-radius: 12px; padding: 8px; }
.code { font-size: 2rem; font-weight: 800; letter-spacing: .18em; text-align: center; margin: 6px 0; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { flex: 1; font-size: .85rem; }

/* playing (guests and moderation) */
.answers { display: grid; gap: 10px; }
.answer {
  font: inherit; font-size: 1.1rem; font-weight: 700; text-align: left; color: #fff; border: 0; border-radius: 16px;
  padding: 18px 18px; min-height: 64px; cursor: pointer; box-shadow: var(--shadow);
}
.answer:nth-child(1) { background: var(--a1); } .answer:nth-child(2) { background: var(--a2); }
.answer:nth-child(3) { background: var(--a3); } .answer:nth-child(4) { background: var(--a4); }
.answer[disabled] { cursor: default; opacity: .45; }
.answer.mine { opacity: 1; outline: 4px solid var(--ink); outline-offset: 2px; }
.answer.right { opacity: 1; }
.answer.wrong { opacity: .3; }
.timer { height: 8px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; margin: 10px 0 16px; }
.timer > div { height: 100%; background: var(--gold); width: 100%; transition: width .25s linear; }
.qbig { font-size: clamp(1.3rem, 5vw, 1.8rem); font-weight: 750; line-height: 1.25; margin: 4px 0 14px; }
.meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .9rem; }
.result { font-size: 1.4rem; font-weight: 800; }
.result.ok { color: var(--ok); } .result.bad { color: var(--bad); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar { position: relative; background: var(--bg-soft); border-radius: 12px; overflow: hidden; }
.bar > div { position: absolute; inset: 0 auto 0 0; background: var(--line); }
.bar.right > div { background: var(--ok); opacity: .35; }
.bar span { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; font-weight: 650; }
.board { list-style: none; margin: 0; padding: 0; }
.board li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.board li:last-child { border-bottom: 0; }
.board .pl { width: 2.2em; font-weight: 800; color: var(--muted); }
.board .nm { flex: 1; font-weight: 650; overflow-wrap: anywhere; }
.board .pt { font-variant-numeric: tabular-nums; }
.board li.me { background: var(--gold-soft); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.pulse { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); margin-right: 8px; animation: pulse 2s infinite; vertical-align: middle; }
@keyframes pulse { 50% { opacity: .3; } }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 10;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 650;
  box-shadow: var(--shadow); transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.price { font-size: 1.6rem; font-weight: 750; }
.ticks { list-style: none; padding: 0; margin: 0; }
.ticks li { padding-left: 1.4em; position: relative; margin-bottom: 6px; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 800; }

/* screen view for a projector */
body.screen { background: #120f17; color: #f5f1f8; }
body.screen .top, body.screen footer, body.screen .testbar { display: none; }
body.screen main .wrap { max-width: 1400px; padding: 3vh 4vw; }
.scr { min-height: 92vh; display: flex; flex-direction: column; gap: 3vh; }
.scr .title { font-size: 3.2vh; color: #cbbfd6; display: flex; justify-content: space-between; }
.scr .q { font-size: 6vh; font-weight: 800; line-height: 1.15; }
.scr .opts { display: grid; grid-template-columns: 1fr 1fr; gap: 2vh; }
.scr .opt { border-radius: 2vh; padding: 3vh 2.5vw; font-size: 4vh; font-weight: 750; color: #fff; position: relative; overflow: hidden; }
.scr .opt:nth-child(1) { background: #8e2c48; } .scr .opt:nth-child(2) { background: #2f6f8f; }
.scr .opt:nth-child(3) { background: #b07a14; } .scr .opt:nth-child(4) { background: #4f7a4a; }
.scr .opt.dim { opacity: .25; }
.scr .opt .n { position: absolute; right: 2vw; bottom: 1.5vh; font-size: 3vh; opacity: .9; }
.scr .count { font-size: 3.5vh; color: #cbbfd6; display: flex; justify-content: space-between; align-items: center; }
.scr .clock { font-size: 7vh; font-weight: 800; color: #ecc06a; font-variant-numeric: tabular-nums; }
.scr .join { display: grid; grid-template-columns: auto 1fr; gap: 5vw; align-items: center; margin: auto 0; }
.scr .join img { width: 42vh; height: 42vh; background: #fff; border-radius: 2vh; padding: 1.5vh; }
.scr .join .big { font-size: 7vh; font-weight: 800; line-height: 1.1; margin-bottom: 3vh; }
.scr .join .code { font-size: 9vh; letter-spacing: .15em; color: #ecc06a; text-align: left; }
.scr .join .url { font-size: 3.2vh; color: #cbbfd6; }
.scr .note { font-size: 3.5vh; color: #ecc06a; }
.scr .podium { display: flex; flex-direction: column; gap: 1.6vh; font-size: 4.5vh; }
.scr .podium div { display: flex; justify-content: space-between; border-bottom: 1px solid #3a3145; padding-bottom: 1vh; }
.scr .podium div:first-child { color: #ecc06a; font-size: 6.5vh; font-weight: 800; }
.scr .cols { display: grid; grid-template-columns: 2fr 1fr; gap: 4vw; }

@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } .timer > div { transition: none; } }

/* Frequently asked questions below the landing view (static HTML, also read by search engines) */
.faq { padding: 4px 0 28px; }
.faq h2 { margin: 0 0 12px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
.faq[hidden] { display: none; }
