:root {
  --bg: #0f172a;
  --panel: #111827;
  --panel-2: #1f2937;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --ok: #10b981;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

/* ===== Dashboard ===== */

.dashboard .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid #1f2937;
}

.dashboard .topbar h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.dashboard .meta {
  color: var(--muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
  transition: background 0.2s;
}
.dot.on { background: var(--ok); }

.grid {
  display: grid;
  grid-template-columns: minmax(360px, 480px) 1fr;
  gap: 24px;
  padding: 24px 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

.qr-pane .qr-card {
  background: var(--panel);
  border: 1px solid #1f2937;
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}
.qr-card h2 {
  margin: 0 0 16px;
  font-size: 20px;
  color: var(--muted);
  font-weight: 500;
}
.qr-card img {
  width: 100%;
  max-width: 420px;
  height: auto;
  background: white;
  border-radius: 12px;
  padding: 12px;
}
.vote-url {
  margin-top: 16px;
  word-break: break-all;
}
.vote-url a {
  color: #60a5fa;
  text-decoration: none;
  font-size: 14px;
}
.hint {
  color: var(--muted);
  font-size: 14px;
  margin: 12px 0 0;
}

.results-pane h2 {
  margin: 0 0 20px;
  font-size: 22px;
  color: var(--muted);
  font-weight: 500;
}
.results {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.row {
  background: var(--panel);
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 18px 20px;
}
.row-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 12px;
}
.row .rank {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}
.row .label {
  flex: 1;
  font-size: 20px;
  font-weight: 500;
}
.row .count {
  color: var(--muted);
  font-size: 16px;
}
.row .count strong {
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
}
.row .count em {
  font-style: normal;
  margin-left: 6px;
}
.bar-track {
  width: 100%;
  height: 18px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Vote (mobile) ===== */

.vote {
  background: linear-gradient(180deg, #0f172a, #111827);
}
.vote-wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.vote h1 {
  margin: 8px 0 8px;
  font-size: 26px;
  line-height: 1.3;
}
.vote .sub {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 14px;
}
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.opt {
  --accent: #3b82f6;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  background: var(--panel);
  border: 2px solid #1f2937;
  color: var(--text);
  padding: 18px 18px;
  border-radius: 14px;
  font-size: 18px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.2s, background 0.2s;
}
.opt:active { transform: scale(0.99); }
.opt:hover:not(:disabled) { border-color: var(--accent); }
.opt:disabled { opacity: 0.55; cursor: not-allowed; }
.opt.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--panel));
}
.opt .num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.opt .text { flex: 1; }

.status {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  min-height: 1.4em;
}

.result-preview {
  margin-top: 28px;
  background: var(--panel);
  border: 1px solid #1f2937;
  border-radius: 14px;
  padding: 18px;
}
.result-preview.hidden { display: none; }
.result-preview h3 {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--muted);
  font-weight: 500;
}
.result-preview ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mini-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 4px;
}
.mini-track {
  height: 8px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
}
.mini-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 0.4s ease;
}
