/* Infoplaza AI quiz — shared styles. Palette from the Infoplaza Business theme. */
:root {
  --green-950: #0a2a1f;
  --green-900: #0e3528;
  --green-800: #124633;
  --accent: #00bf78;
  --mint: #71d7af;
  --mint-50: #d9fff1;
  --pink: #eb486a;
  --bg: #f2f2ed;
  --ink: #2e2e2a;
  --muted: #6f6f6b;
  --line: #e2e2dc;
  --radius: 16px;
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.wordmark { font-weight: 700; letter-spacing: -0.02em; }
.wordmark b { color: var(--accent); font-weight: 700; }

/* ─────────────── Phone (participant) ─────────────── */
body.phone {
  min-height: 100dvh;
  background: radial-gradient(120% 80% at 10% 0%, #155a40 0%, var(--green-900) 55%, var(--green-950) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.phone header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; gap: 12px;
}
.phone header .wordmark { font-size: 15px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.chip .score { color: var(--mint); }
.phone main { flex: 1; display: flex; flex-direction: column; padding: 8px 18px 28px; gap: 16px; }
.phone .center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; }
.phone .kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 12px; font-weight: 600; color: var(--mint); }
.phone .bigname { font-size: clamp(30px, 9vw, 44px); font-weight: 700; line-height: 1.1; word-break: break-word; }
.phone .qtext { font-size: clamp(20px, 5.6vw, 26px); font-weight: 600; line-height: 1.3; margin: 0; }
.phone .meta { display: flex; justify-content: space-between; font-size: 13px; color: rgba(255,255,255,0.7); }
.timerbar { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.12); overflow: hidden; }
.timerbar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.1s linear; }
.timerbar.low > i { background: var(--pink); }

.answers { display: grid; gap: 10px; }
.answer {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  min-height: 64px; padding: 12px 16px; border-radius: var(--radius); border: 0;
  background: #fff; color: var(--ink); font-size: 17px; font-weight: 600;
  box-shadow: 0 2px 0 rgba(0,0,0,0.25);
  transition: transform 0.08s ease, opacity 0.2s ease;
}
.answer:active { transform: scale(0.98); }
.answer .letter {
  flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 16px;
}
.answer[disabled] { opacity: 0.55; cursor: default; }
.answers.scale { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.answers.scale .answer { flex-direction: column; justify-content: center; text-align: center; min-height: 110px; gap: 8px; font-size: 14px; padding: 10px 6px; }
.answers.scale .answer .letter { width: 30px; height: 30px; border-radius: 99px; }

.locked { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16); border-radius: var(--radius); padding: 16px; display: flex; gap: 14px; align-items: center; }
.locked .letter { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; }

.bars { display: grid; gap: 8px; }
.bar { position: relative; border-radius: 12px; background: rgba(255,255,255,0.08); overflow: hidden; min-height: 44px; display: flex; align-items: center; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 12px; opacity: 0.9; transition: width 0.35s ease; }
.bar > span { text-shadow: 0 1px 3px rgba(0,0,0,0.35); position: relative; display: flex; justify-content: space-between; width: 100%; padding: 8px 12px; gap: 10px; font-size: 14px; font-weight: 600; }
.bar.mine { outline: 2px solid #fff; }
.bar.correct { outline: 3px solid #fff; }
.bar.dim { opacity: 0.45; }

.feed { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 28px; }
.feed span { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: rgba(113,215,175,0.16); color: var(--mint-50); animation: pop 0.35s ease; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.verdict { font-size: 40px; font-weight: 700; }
.verdict.ok { color: var(--mint); }
.verdict.no { color: #ffb3c2; }
.points { font-size: 22px; font-weight: 600; }
.ranklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; width: 100%; }
.ranklist li { display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,0.08); font-weight: 600; }
.ranklist li.me { background: var(--accent); color: var(--green-950); }
.status-banner { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--pink); color: #fff; padding: 8px 14px; border-radius: 99px; font-size: 13px; font-weight: 600; z-index: 10; }

/* ─────────────── Screen (projector) ─────────────── */
body.screen {
  height: 100vh; overflow: hidden; color: #fff;
  background: radial-gradient(110% 90% at 0% 0%, #176145 0%, var(--green-800) 45%, var(--green-950) 100%);
  font-size: 1.15vw;
}
.screen .frame { position: absolute; inset: 0; padding: 3.2vw 4vw; display: flex; flex-direction: column; }
.screen .top { display: flex; justify-content: space-between; align-items: center; font-size: 1.1vw; }
.screen .top .wordmark { font-size: 1.5vw; }
.screen .kicker { text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; color: var(--mint); font-size: 1vw; }
.screen .miniqr { display: flex; align-items: center; gap: 1vw; font-size: 1vw; color: rgba(255,255,255,0.8); }
.screen .miniqr .qr { width: 6.5vw; height: 6.5vw; border-radius: 0.6vw; overflow: hidden; background: #fff; }
.screen .qr svg { width: 100%; height: 100%; display: block; }

.lobby { flex: 1; display: grid; grid-template-columns: 30vw 1fr; gap: 5vw; align-items: center; }
.lobby .qrcard { background: #fff; border-radius: 2vw; padding: 1.6vw; box-shadow: 0 2vw 4vw rgba(0,0,0,0.35); }
.lobby .qrcard .qr { width: 100%; aspect-ratio: 1; }
.lobby .qrcard .url { color: var(--green-800); text-align: center; font-weight: 700; font-size: 1.8vw; margin-top: 0.6vw; }
.lobby h1 { font-size: 4.6vw; line-height: 1.05; margin: 0.6vw 0 1vw; letter-spacing: -0.02em; }
.lobby .sub { font-size: 1.6vw; color: rgba(255,255,255,0.8); margin: 0 0 2.4vw; }
.lobby .count { display: flex; align-items: baseline; gap: 1vw; }
.lobby .count b { font-size: 6vw; color: var(--accent); line-height: 1; }
.lobby .count span { font-size: 1.6vw; color: rgba(255,255,255,0.8); }
.namecloud { display: flex; flex-wrap: wrap; gap: 0.6vw; margin-top: 2vw; max-height: 15vw; overflow: hidden; }
.namecloud span { padding: 0.4vw 1vw; border-radius: 99px; background: rgba(255,255,255,0.1); font-size: 1.1vw; font-weight: 500; animation: pop 0.4s ease; }
.namecloud span:first-child { background: var(--accent); color: var(--green-950); font-weight: 700; }

.qview { flex: 1; display: grid; grid-template-columns: 1fr 15vw; gap: 3vw; margin-top: 2vw; min-height: 0; }
.qview h1 { font-size: 3.1vw; line-height: 1.2; margin: 0.6vw 0 2.2vw; letter-spacing: -0.01em; }
.qview .left { display: flex; flex-direction: column; min-height: 0; }
.sbars { display: grid; gap: 1vw; }
.sbar { position: relative; display: flex; align-items: center; min-height: 4.6vw; border-radius: 1.1vw; background: rgba(255,255,255,0.08); overflow: hidden; transition: opacity 0.3s; }
.sbar > i { position: absolute; inset: 0 auto 0 0; transition: width 0.4s ease; opacity: 0.95; }
.sbar > .cmp { position: absolute; left: 0; bottom: 0; height: 0.45vw; background: rgba(255,255,255,0.85); transition: width 0.4s ease; }
.sbar > span { text-shadow: 0 1px 3px rgba(0,0,0,0.35); position: relative; display: flex; align-items: center; gap: 1.2vw; width: 100%; padding: 0.8vw 1.4vw; font-size: 1.7vw; font-weight: 600; }
.sbar .letter { width: 2.8vw; height: 2.8vw; border-radius: 0.7vw; display: grid; place-items: center; font-weight: 700; flex: none; background: rgba(0,0,0,0.25); }
.sbar .label { flex: 1; }
.sbar .num { font-variant-numeric: tabular-nums; min-width: 9vw; text-align: right; }
.sbar.correct { outline: 0.3vw solid #fff; }
.sbar.correct .label::after { content: "  ✓"; }
.sbar.dim { opacity: 0.4; }
.legend { margin-top: 1vw; font-size: 1.1vw; color: rgba(255,255,255,0.8); display: flex; gap: 2vw; align-items: center; }
.legend i { display: inline-block; width: 2vw; height: 0.45vw; background: rgba(255,255,255,0.85); vertical-align: middle; margin-right: 0.6vw; }

.right { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vw; }
.ring { position: relative; width: 13vw; height: 13vw; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 4.8vw; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring.low .num { color: #ffb3c2; }
.answered { text-align: center; }
.answered b { display: block; font-size: 4vw; line-height: 1; color: var(--accent); }
.answered span { font-size: 1.2vw; color: rgba(255,255,255,0.8); }
.sfeed { display: flex; flex-wrap: wrap; gap: 0.6vw; min-height: 2.4vw; margin-top: auto; padding-top: 1.6vw; }
.sfeed span { padding: 0.35vw 0.9vw; border-radius: 99px; background: rgba(113,215,175,0.18); color: var(--mint-50); font-size: 1vw; animation: pop 0.35s ease; }
.stamp { font-size: 2vw; font-weight: 700; color: var(--mint); text-align: center; }

.board { flex: 1; display: flex; flex-direction: column; margin-top: 2vw; }
.board h1 { font-size: 4vw; margin: 0.4vw 0 2vw; }
.board ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: column; grid-template-rows: repeat(5, auto); gap: 1vw 3vw; }
.board li { display: flex; align-items: center; gap: 1.4vw; padding: 1vw 1.6vw; border-radius: 1.1vw; background: rgba(255,255,255,0.08); font-size: 1.9vw; font-weight: 600; animation: pop 0.4s ease both; }
.board li .r { width: 3.2vw; height: 3.2vw; border-radius: 99px; display: grid; place-items: center; background: rgba(255,255,255,0.14); font-size: 1.5vw; }
.board li:nth-child(1) .r { background: #f2c94c; color: var(--green-950); }
.board li:nth-child(2) .r { background: #d6d6d0; color: var(--green-950); }
.board li:nth-child(3) .r { background: #d79a5b; color: var(--green-950); }
.board li .n { flex: 1; }
.board li .s { color: var(--mint); font-variant-numeric: tabular-nums; }

/* ─────────────── Admin ─────────────── */
body.admin { background: var(--bg); min-height: 100vh; font-size: 14px; }
.admin .bar-top {
  position: sticky; top: 0; z-index: 5; background: var(--green-800); color: #fff;
  padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center;
}
.admin .bar-top .wordmark { font-size: 16px; }
.admin .live { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; flex: 1; }
.admin .pill { padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,0.12); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.admin .pill.open { background: var(--accent); color: var(--green-950); }
.admin .pill.closed { background: var(--pink); }
.admin .controls { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { border: 0; border-radius: 10px; padding: 8px 14px; font-weight: 600; background: #fff; color: var(--ink); box-shadow: 0 1px 0 rgba(0,0,0,0.15); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.primary { background: var(--accent); color: var(--green-950); }
.btn.dark { background: var(--green-800); color: #fff; }
.btn.danger { background: var(--pink); color: #fff; }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.admin main { max-width: 1320px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 1fr 360px; gap: 20px; }
a.btn { text-decoration: none; text-align: center; }
.admin .card { background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.admin h2 { font-size: 15px; margin: 0 0 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.qlist { display: grid; gap: 8px; }
.qrow { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.qrow.current { border-color: var(--accent); background: var(--mint-50); }
.qrow .no { font-weight: 700; color: var(--muted); padding-top: 2px; }
.qrow .t { font-weight: 600; }
.qrow .sub { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.qrow .acts { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--green-800); }
.badge.quiz { background: #ffe1e8; color: #a3203c; }
.badge.poll { background: #e1ecff; color: #234f99; }
.badge.scale { background: var(--mint-50); color: var(--green-800); }
.minibars { display: flex; gap: 3px; align-items: flex-end; height: 22px; }
.minibars i { width: 10px; border-radius: 2px; background: var(--mint); min-height: 2px; }
.minibars i.ok { background: var(--accent); }
.plist { display: grid; gap: 4px; max-height: 60vh; overflow: auto; }
.prow { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.prow:hover { background: var(--bg); }
.prow .dot { width: 8px; height: 8px; border-radius: 99px; background: #c9c9c3; flex: none; }
.prow .dot.on { background: var(--accent); }
.prow .n { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.prow .s { color: var(--muted); font-variant-numeric: tabular-nums; }
.side { display: grid; gap: 20px; align-content: start; }
dialog { border: 0; border-radius: var(--radius); padding: 22px; width: min(640px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
dialog::backdrop { background: rgba(14,53,40,0.5); }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.form input, .form select, .form textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-weight: 400; }
.form textarea { min-height: 120px; resize: vertical; }
.form .row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form .check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.err { color: #a3203c; font-weight: 600; min-height: 1em; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--green-800); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; z-index: 20; }
.toast.bad { background: var(--pink); }
.gate { max-width: 380px; margin: 14vh auto; }
.note { font-size: 12px; background: #fff7d6; border-radius: 8px; padding: 6px 8px; margin-top: 6px; color: #6b5800; }
@media (max-width: 900px) { .admin main { grid-template-columns: 1fr; } }

.sbars.scale .letter { display: none; }
