:root {
  --bg: #1C1F28;
  --card: #272B36;
  --card2: #31364300;
  --line: #3A3F4D;
  --txt: #F8F9FB;
  --muted: #AEB4C2;
  --or: #E0592F;
  --am: #F2B34A;
  --bl: #7FA8F7;
  --ok: #4CC38A;
  --bad: #E5484D;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--txt); font-family: Arial, Helvetica, sans-serif; }
h1, h2, h3, .hf { font-family: Montserrat, Arial, sans-serif; margin: 0; }
a { color: var(--bl); }
button {
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; cursor: pointer;
  border: 0; border-radius: 10px; padding: 12px 18px; font-size: 15px;
  background: var(--or); color: #fff;
}
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--txt); }
button.blue { background: var(--bl); color: #10131a; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, textarea {
  width: 100%; background: #12141b; color: var(--txt); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; font-size: 16px; font-family: Arial, sans-serif;
}
textarea { min-height: 180px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus { outline: 2px solid var(--or); border-color: transparent; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; }
.muted { color: var(--muted); }
.kicker { font-family: Montserrat, Arial, sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--am); }
.hex {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 52px; height: 46px; background: var(--or); color: #fff; font-family: Montserrat, Arial, sans-serif; font-weight: 800; font-size: 20px;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.row { display: flex; gap: 12px; align-items: center; }
.stack > * + * { margin-top: 12px; }
.score { font-family: Montserrat, Arial, sans-serif; font-weight: 800; }
.s-low { color: var(--bad); } .s-mid { color: var(--am); } .s-high { color: var(--ok); }
.bg-low { background: rgba(229,72,77,.22); } .bg-mid { background: rgba(242,179,74,.22); } .bg-high { background: rgba(76,195,138,.25); }
ul.clean { margin: 6px 0 0; padding-left: 18px; } ul.clean li { margin: 4px 0; line-height: 1.4; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #12141b; border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 3px solid var(--line); border-top-color: var(--or); border-radius: 50%; animation: spin 1s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* ---------- participant (mobile first) ---------- */
.mobile { max-width: 640px; margin: 0 auto; padding: 16px; }
.mobile header { display: flex; justify-content: space-between; align-items: center; padding: 4px 0 16px; }
.brand { font-family: Montserrat, Arial, sans-serif; font-weight: 800; color: var(--or); letter-spacing: .02em; }
.brand span { color: var(--txt); }
.fb-score { font-size: 44px; line-height: 1; }
.hist-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist-item:last-child { border-bottom: 0; }
details summary { cursor: pointer; font-family: Montserrat, Arial, sans-serif; font-weight: 700; }

/* ---------- admin (projector) ---------- */
.admin { padding: 20px 28px; }
.topbar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.topbar .grow { flex: 1; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper .title { font-family: Montserrat, Arial, sans-serif; font-weight: 800; font-size: 22px; max-width: 640px; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.tabs button.active { background: var(--card); color: var(--txt); border-color: var(--or); }
.grid2 { display: grid; grid-template-columns: 360px 1fr; gap: 16px; }
.bigstat { font-family: Montserrat, Arial, sans-serif; font-size: 56px; font-weight: 800; line-height: 1; }
.histo { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 10px; }
.histo .bar { flex: 1; background: var(--or); border-radius: 6px 6px 0 0; min-height: 2px; position: relative; }
.histo .bar span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); }
.histo-x { display: flex; gap: 6px; } .histo-x div { flex: 1; text-align: center; font-size: 12px; color: var(--muted); }
.answers { max-height: 62vh; overflow: auto; }
.answer { display: grid; grid-template-columns: 54px 1fr; gap: 12px; padding: 12px; border-radius: 10px; cursor: pointer; }
.answer:hover { background: #12141b; }
.answer .score { font-size: 26px; text-align: center; }
table.matrix { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: 14px; }
table.matrix th { font-family: Montserrat, Arial, sans-serif; font-size: 11px; color: var(--muted); font-weight: 700; padding: 4px; }
table.matrix td { text-align: center; padding: 8px 4px; border-radius: 6px; background: #12141b; }
table.matrix td.bg-low { background: rgba(229,72,77,.35); }
table.matrix td.bg-mid { background: rgba(242,179,74,.35); }
table.matrix td.bg-high { background: rgba(76,195,138,.4); }
table.matrix td.name { text-align: left; background: transparent; cursor: pointer; white-space: nowrap; font-weight: 700; }
table.matrix tr.cur-col td.cur, table.matrix th.cur { outline: 2px solid var(--or); }
.critbars .cb { display: grid; grid-template-columns: 34px 220px 1fr 50px; gap: 10px; align-items: center; margin: 6px 0; }
.critbars .track { height: 14px; background: #12141b; border-radius: 7px; overflow: hidden; }
.critbars .fill { height: 100%; background: linear-gradient(90deg, var(--or), var(--am)); }
.lb { display: grid; gap: 10px; }
.lb .item { display: grid; grid-template-columns: 70px 1fr 120px; gap: 16px; align-items: center; background: var(--card); padding: 16px 20px; border-radius: var(--radius); }
.lb .rank { font-family: Montserrat, Arial, sans-serif; font-size: 34px; font-weight: 800; color: var(--muted); text-align: center; }
.lb .item.top1 { box-shadow: 0 0 0 2px var(--am); } .lb .item.top1 .rank { color: var(--am); }
.lb .item.top2 .rank, .lb .item.top3 .rank { color: var(--or); }
.lb .total { font-family: Montserrat, Arial, sans-serif; font-size: 36px; font-weight: 800; text-align: right; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); background: var(--bg); border-left: 1px solid var(--line); padding: 22px; overflow: auto; z-index: 20; box-shadow: -20px 0 40px rgba(0,0,0,.4); }
.modal { position: fixed; inset: 0; background: rgba(10,12,18,.88); display: flex; align-items: center; justify-content: center; z-index: 30; }
.modal .qrbox { background: #fff; padding: 24px; border-radius: 20px; text-align: center; color: #1C1F28; }
.modal .qrbox img { width: min(70vh, 80vw); height: auto; display: block; }
.qrmini { width: 64px; height: 64px; background: #fff; border-radius: 8px; padding: 3px; cursor: pointer; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .critbars .cb { grid-template-columns: 30px 120px 1fr 44px; } }
