* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #f1f5f9;
}

h2 {
  font-size: 1.4rem;
  margin: 1.5rem 0 0.8rem;
  color: #cbd5e1;
}

.card {
  background: #1e293b;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

label {
  display: block;
  margin: 12px 0 6px;
  color: #94a3b8;
  font-size: 0.9rem;
}

input[type="text"], input[type="number"] {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid #334155;
  background: #0f172a;
  color: #f1f5f9;
  font-size: 1rem;
}

input:focus {
  outline: none;
  border-color: #3b82f6;
}

button {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  background: #3b82f6;
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 12px;
}

button:hover { background: #2563eb; }
button:disabled { background: #475569; cursor: not-allowed; }
button.danger { background: #ef4444; }
button.danger:hover { background: #dc2626; }

.role-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}

.role-buttons a {
  display: block;
  padding: 40px 20px;
  text-align: center;
  background: #1e293b;
  border-radius: 12px;
  text-decoration: none;
  color: #f1f5f9;
  font-size: 1.4rem;
  font-weight: 600;
  border: 2px solid #334155;
  transition: all 0.15s;
}

.role-buttons a:hover {
  border-color: #3b82f6;
  background: #1e3a5f;
}

.vote-code {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.4rem;
  text-align: center;
  background: #fbbf24;
  color: #0f172a;
  padding: 20px;
  border-radius: 12px;
  margin: 16px 0;
}

.vote-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.vote-buttons button {
  padding: 32px;
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.vote-buttons button.A { background: #ef4444; }
.vote-buttons button.B { background: #f59e0b; }
.vote-buttons button.C { background: #10b981; }
.vote-buttons button.D { background: #8b5cf6; }
.vote-buttons button.selected { box-shadow: 0 0 0 4px #fff inset; }

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.bar-row {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  gap: 12px;
  align-items: center;
}

.bar-label {
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  padding: 8px;
  border-radius: 6px;
  color: white;
}
.bar-label.A { background: #ef4444; }
.bar-label.B { background: #f59e0b; }
.bar-label.C { background: #10b981; }
.bar-label.D { background: #8b5cf6; }

.bar-track {
  background: #334155;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.4s ease;
  display: flex;
  align-items: center;
  padding-left: 12px;
  color: white;
  font-weight: 600;
  white-space: nowrap;
}

.bar-count {
  text-align: right;
  font-size: 1.2rem;
  font-weight: 600;
  color: #cbd5e1;
}

.status {
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  font-weight: 500;
}
.status.ok { background: #064e3b; color: #6ee7b7; }
.status.error { background: #7f1d1d; color: #fca5a5; }
.status.info { background: #1e3a5f; color: #93c5fd; }

.total {
  text-align: center;
  font-size: 1.2rem;
  color: #94a3b8;
  margin-top: 20px;
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.muted { color: #64748b; font-size: 0.9rem; }

a { color: #60a5fa; }
