/* VoteFlow — shared UI */
:root {
  --bg: #f4f4fb;
  --surface: #ffffff;
  --surface-2: #f0f0fa;
  --text: #191932;
  --muted: #6b6b8a;
  --line: #e3e3f2;
  --primary: #5b3df5;
  --primary-2: #8b5cf6;
  --primary-soft: #ece7fe;
  --accent: #06b6d4;
  --danger: #e11d48;
  --success: #10b981;
  --warning: #f59e0b;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(30, 27, 75, .08);
  --grad: linear-gradient(135deg, #5b3df5 0%, #8b5cf6 55%, #06b6d4 130%);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
[v-cloak] { display: none; }

h1, h2, h3 { margin: 0 0 .4em; font-weight: 700; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; cursor: pointer;
  padding: 10px 18px; font-size: 14px; font-weight: 600; font-family: inherit;
  background: var(--surface-2); color: var(--text);
  transition: transform .08s ease, box-shadow .15s ease, opacity .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(30,27,75,.12); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--grad); color: #fff; }
.btn-danger { background: #fde8ee; color: var(--danger); }
.btn-danger.solid { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); box-shadow: none; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 12px; }

/* --- Forms --- */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 10px 13px; font-size: 14.5px; font-family: inherit;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft);
}
.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }

/* --- Cards / layout --- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px;
}
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}
.badge.live { background: #fee2e2; color: var(--danger); }
.badge.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite; }
.badge.ok { background: #d1fae5; color: #047857; }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }

/* --- Modal --- */
.modal-back {
  position: fixed; inset: 0; background: rgba(20, 16, 50, .45);
  display: flex; align-items: center; justify-content: center; padding: 18px; z-index: 50;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.3);
  width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; padding: 26px;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.96); opacity: 0 } to { transform: scale(1); opacity: 1 } }

/* --- Result bars --- */
.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-item { position: relative; }
.bar-label { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; margin-bottom: 5px; }
.bar-track { height: 30px; border-radius: 9px; background: rgba(127,127,160,.16); overflow: hidden; }
.bar-fill {
  height: 100%; border-radius: 9px; background: var(--grad);
  min-width: 4px; transition: width .5s cubic-bezier(.2,.8,.2,1);
  display: flex; align-items: center; justify-content: flex-end;
}
.bar-item.correct .bar-fill { background: linear-gradient(135deg, #059669, #34d399); }
.bar-item.correct .bar-label { color: var(--success); }
.bar-item.wrong-reveal .bar-fill { opacity: .45; }

/* --- Toast --- */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #191932; color: #fff; padding: 11px 20px; border-radius: 12px;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 100;
  animation: pop .2s ease;
}
.toast.error { background: var(--danger); }

/* --- Full-screen stage (presenter + audience) --- */
.stage {
  min-height: 100vh; min-height: 100dvh;
  background: var(--grad);
  background-size: cover; background-position: center;
  position: relative; color: #fff;
  display: flex; flex-direction: column;
}
.stage::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(12,8,40,.55), rgba(12,8,40,.72));
  pointer-events: none;
}
.stage > * { position: relative; z-index: 1; }
.stage .glass {
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}

/* choice buttons on audience view */
.opt-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 15px 18px; border-radius: 14px; cursor: pointer; text-align: left;
  background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.22);
  color: #fff; font-size: 16.5px; font-weight: 600; font-family: inherit;
  transition: background .15s, border-color .15s, transform .08s;
}
.opt-btn:hover { background: rgba(255,255,255,.2); }
.opt-btn:active { transform: scale(.985); }
.opt-btn.selected { background: rgba(255,255,255,.92); color: var(--primary); border-color: #fff; }
.opt-btn .dot {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  border: 2.5px solid currentColor; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.opt-btn.multiple .dot { border-radius: 6px; }

@media (max-width: 640px) {
  .card { padding: 16px; }
  .btn-lg { padding: 12px 20px; font-size: 15px; }
}
